GenAI/Large Language Models (LLMs) for Advanced OCI Policy Analysis

1. Current State

  • “AI Assist” (ai_repo.py) supports LLM-driven analysis of a single policy statement using the selected OCI GenAI model and tailored prompt.

  • All existing simplification, consolidation, and overlap logic is rule-based, utilizing Python strategies in the consolidation/intelligence engine.


2. GenAI/LLM Value-Add Scenarios

a. Simplification

Goal: Rewrite multiple policy statements for clarity, conciseness, and minimalism, preserving intent.

LLM Role: Transform verbose/redundant language into simpler forms, clarify complex where clauses, and remove unnecessary logic.

Implementation Strategy:

  • Extend ai_repo.py with a method to receive a list of statements plus optional context (e.g., compartment JSON/tree).

  • Prompt LLM for “minimum equivalent set”—rewriting for clarity and removing redundant logic.

b. Consolidation & Combination

Goal: Merge statements with similar targets or where clauses into fewer, equivalent statements.

LLM Role: Reduce a group of narrowly overlapping policies into the minimal form, considering scope and intent.

Implementation Strategy:

  • Input a full statement list plus compartment context.

  • Prompt: “Given these OCI IAM policy statements and compartment hierarchy, provide a minimal consolidated version, combining scopes and where clauses as possible.”

c. Overlap Detection

Goal: Identify, flag, and suggest removal or merger of redundant or overlapping statements.

LLM Role: Highlight statements with duplicative/overlapping permissions and provide rewrite proposals.

Implementation Strategy:

  • Input all statements plus policy/compartment context.

  • Prompt for overlap annotation: “Identify all pairs/groups in this policy list that grant overlapping permissions. Suggest how to remove redundancy.”



4. Roadmap/Integration Approach

  • Extend ai_repo.py for multi-statement/policy-batch LLM prompts.

  • Prototype and refine prompt templates for simplification, consolidation, and overlap detection.

  • Wire up UI/engine to allow users to select LLM-assisted consolidation as an option.

  • Human confirmation required before applying any LLM-suggested policy changes.

  • Evaluate output against real policies and tune prompt quality iteratively.


5. Summary Task List

  • Implement batch analysis/suggestion calls in ai_repo.py.

  • Develop, tune, and validate prompt patterns for the target use cases.

  • Integrate LLM-driven logic as an optional pathway in the consolidation UI/engine.

  • Test with real and synthetic policy sets, validate for security and correctness.


This context doc was generated on 2026-03-12 as part of ongoing GenAI strategy discussion for OCI Policy Analysis.