Skip to content

epic: Agent Platform OPA - Fine-Grained Authorization for AI Agents #1789

Closed
6 of 6 issues completed
Closed

Description

@davidhadas

Executive summary. Group-level RBAC is too blunt for agentic systems, where the right answer to "may A call B?" depends on the caller, the callee, the user being served, and the task in flight — and getting it wrong invites confused-deputy data leaks. This epic adds an OPA-based, context-aware authorization layer to AuthBridge: a per-agent/per-tool policy enforcement point with a co-located Rego decision point, fed by a cluster Bundle Service that distributes SPIFFE-scoped policy bundles so each workload sees only the rules that apply to it. The outcome is an IdP-agnostic, Kubernetes-native, zero-trust PDP that evaluates inbound and outbound requests and responses with full runtime context — ready for adoption by Red Hat and customers.

Problem

Summary

We add OPA to AuthBridge to support FGA. We also add a mechanism to distribute OPA Bundles to AuthBridge instances to support the a distributed PDP model we introduce.

Progress
Take 1 :
[x] - OPA Plugin for AutBridge - rossoctl/cortex#427
[x] - OPA Bundle Service - rossoctl/operator#415
[ ] - OPA Documentation - #2138

Take 2:
[ ] Agree on a second, revised design for a Bundle Service integrated into the Operator, using a mounted ConfigMap to deliver rules to the OPA Plugin. Discuss as part of this epic.
[ ] Operator Revised Design compiling the rule sets for each OPA Plugin in a ConfigMap - rossoctl/operator#469
[ ] Revised OPA Plugin using a mounted ConfigMap - rossoctl/cortex#427

The Problem We Are Solving

Agent‑based systems cannot rely on broad, group‑level authorization.
Three realities make fine‑grained control essential:

Confused‑deputy risks — Unrestricted agent‑to‑agent calls enable accidental data leaks. One agent may hold sensitive data; another may publish externally. If they can freely invoke each other, a malicious or mistaken request can route sensitive data to the wrong place.

User‑dependent access — Whether Agent A may call Agent B or Tool X depends on the requesting user. A data‑retrieval agent may access records only for users with the right role or relationship. The same call must be blocked for others.

Task‑dependent access — Authorization must reflect the task context, not just the agent. A document‑summary task may require access to sensitive data; a notification‑sending task should not. Even when performed by the same agent, the allowed interactions differ.

Effective access control must evaluate at least these dimensions:

  • The identity of the agent or tool receiving the request
  • The identity of the user on whose behalf the request is made
  • The task or operation being performed
  • The identity of the agent initiating the request

Only by combining these dimensions can we prevent confused‑deputy scenarios, enforce user‑specific permissions, and ensure task‑appropriate access.

Requirements

To support this model in Kagenti, the system must satisfy sevral foundational requirements:

  • We need a Policy Decision Point (PDP) that is IdP‑agnostic, avoiding tight coupling to any single identity provider like Keycloak.
  • We need per‑agent and per-tool identity to make meaningful decisions. SPIFFE may provide the necessary identity foundation.
  • We need a zero‑trust access‑control model that understands user identity, task, tools, agent identity, tool identity, LLMs, and request context as part of the authorization decision — far beyond what mTLS or Kubernetes namespaces alone can express.
  • We need to align with Kubernetes common practices to streamline operational workflows, policy distribution, and lifecycle management.
  • We need open composable solution to support different user requirements. This includes supporting AuthZen to enable remote PDPs which may for example implement ReBAC access control

design

The Solution: OPA at the AuthBridge (Per‑Agent and Per‑Tool Rego Controls)

Kagenti implements fine‑grained, context‑aware authorization using an OPA‑based architecture designed specifically for multi‑agent systems. The solution consists of two core components:

OPA Plugin (AuthBridge sidecar) - A per‑agent, per-tool Policy Enforcement Point (PEP) with a co-located Policy Decision Point (PDP)
OPA Bundle Service (cluster singleton) - Builds and serves per‑agent, per-tool OPA bundles derived from AuthorizationPolicy CRs - moving forward, the Bundle Service should allow us to distribute OPA bundles also to optional Kagenti components such as external OPA‑based PDP (AuthZen Policy Decision Point),  OpenShell, KeyClock, CPAX inner-plugins etc.

OPA Plugin and AuthZen Support

The OPA Plugin supports evaluating Rego policies locally with sub‑millisecond latency. The plugin intercepts traffic, extracts a rich input document that captures the key dimensions required to evaluate user-to-agent, agent‑to‑agent and agent‑to‑tool, agent-to-llm interactions. The input document ensures that authorization decisions can incorporate as a minimum the identity of the caller, the identity of the callee, the identity of the user making the original request and the task. Additional contextual parameters (HTTP headers, request path, inference model, content payloads, tool schemas, etc.) can also be included, enabling even deeper and more expressive policy logic when needed. The plugin supports evaluating both requests and responses; Both inbound and outbound from any Kagenti agent/tool.

AuthZen will be added to the OPA Plugin to allow connecting to remote PDPs supporting AuthZen. The decision if to consult a remote PDP will be done by the Rego Code. This feature is lower piorpirty.

OPA Bundle Service

The OPA Bundle Service implements a standard OPA service for distributing OPA bundles. The bundles are distributed based on client id (SPIFFE). The service generates a dedicated bundle for each agent and each tool. Per‑agent and per-tool bundles enforce strict isolation: each agent receives only the policies relevant to its own identity, reducing blast radius and preventing agents from inferring or accessing rules intended for others.
Each bundle is tied to the component’s SPIFFE identity, enabling Security Engineers and SREs to define four separate Rego files per agent or tool:

  • Inbound request policy
  • Inbound response policy
  • Outbound request policy
  • Outbound response policy

Inbound policies evaluate what is allowed to reach the agent or tool, while outbound policies evaluate what the agent or tool itself is allowed to call or return.

This design is:

  • IdP-agnostic — Works with any identity provider (Keycloak, Entra ID, Okta, custom IdPs). Policies reference identity claims, not a specific token system.
  • Runtime context — Decisions are made at request time with full context.
  • Kubernetes-native — Policies are managed as CRs with schema validation, RBAC, and GitOps workflows — aligned with Kubernetes access-control practices.
  • Expressive — Rego supports RBAC, ABAC, relationship-based rules, content inspection, and combinational logic in a single policy language.
  • No vendor lock-in — OPA is CNCF-graduated. Switching or adding identity providers requires no policy rewrites.

Optional Automation Layer: AIAC (AI Access Control)

AIAC is an optional, non‑blocking automation layer that assists with authoring, validating, and reviewing fine‑grained access policies. AIAC will read current Rego defined in AuthorizationPolicy CRs and will optionally auto-create AuthorizationPolicy CRs for onboarding purposes.

See epic: AI Access Control (AIAC): Human Language Policy based fine-grained Access Control for more details on AIAC.

Goals and non-goals

No response

Success criteria

Adoption by RH and use by customers.

Stories to be associated with this epic

No response

Additional Context

No response

Sub-issues

Sub-issues

6 of 6 Issues completed
Loading 6 sub-issues

Activity

  1. self-assigned this
    on Jun 2, 2026
  2. added
    epic
    Identity
    on Jun 2, 2026
  3. added this to the Release v0.8.0 milestone on Jun 3, 2026
  4. moved this from New /:ToDo to Epics in Rossoctl Issue Prioritizationon Jun 4, 2026
  5. rpelevin commented on Jun 8, 2026

    @rpelevin

    Fine-grained agent authorization gets much stronger if the OPA decision is bound to the exact action envelope, not only caller/callee identity.

    The policy input I would preserve at the enforcement point:

    • caller workload / SPIFFE id;
    • agent id and delegated user/account;
    • tool or service being called;
    • target resource;
    • action type;
    • canonical arguments or payload digest;
    • task/run id;
    • policy bundle version;
    • decision id and expiry.

    Two invariants matter:

    • an allow decision for one tool/resource/args envelope cannot authorize a changed envelope on retry or delegation;
    • a child/subagent can inherit a narrower policy, but cannot widen the parent policy.

    For audit and replay, I would log both the OPA input digest and the policy bundle version that produced the decision. That makes "why was this agent allowed to call this tool for this user on this task?" answerable later.

    Acceptance tests:

    • same caller/tool but changed target or args requires a new decision;
    • stale/expired decision fails closed;
    • missing bundle or invalid Rego output denies;
    • delegated agent cannot relax parent policy;
    • response filtering is tied to the same decision record.
  6. mrsabath commented on Jun 12, 2026

    @mrsabath
    Member

    📊 Status sync — 2026-06-12 (automated rollup, please verify before acting)

    1 of 2 work items merged (50%):

    • kagenti-extensions#427 (OPA plugin) — MERGED 2026-06-04
    • kagenti-operator#415 (Bundle Service serving OPA policy bundles) — OPEN (PR, under review)

    AuthZen support explicitly deferred as lower priority. The inline progress checklist still matches reality (plugin done, Bundle Service in review).

    🔗 Suggestions:

  7. davidhadas commented on Jun 22, 2026

    @davidhadas
    ContributorAuthor

    Take-1 of this epic which is now merged, following OPA standard practices. Yet, it is as @rhuss indicated while reviewing the bundle-service, k8s practices in several manners vary from the OPA practices and may be preferable by upstream. Following these inputs, and study of Authorino design and inputs, I have started to put together a take-2 of this epic. This take-2 will focus on a revised bundle service to be incorporated into the operator, moving any downloading of access rules from the opa plugin to the operator such that the OPA plugin will use a pre-compiled, merged rule sets prepared by the operator and visible to the SREs.

    Here are principles of the new design for review and discussion with upstream.

    Core Design Principles for PDP Policy Assembly

    1. Hierarchical, Multi-Source Input Model
      Policy authorship is scoped by organizational role and impact radius. Each source is authored independently and supports its own Rego/Data pair or CEL logic:
      Ecosystem/Mesh Level (MeshPolicySource): Developer-authored baseline restrictions for mesh-wide interactions (agents, tools, LLMs).
      Global/Cluster Level (ClusterPDPPolicySource): SRE-authored, system-wide baseline rules.
      Tenant/Namespace Level (DomainPDPPolicySource): SRE-authored, domain- or tenant-specific rules.
      Instance/Workload Level (ComponentPDPPolicySource): SRE-authored rules tailored to specific target workloads.

    2. Isolated Compilation & Deterministic Evaluation
      Policies from all levels are isolated via dynamic package/namespace scoping. The control plane uses an auto-generated Master Entrypoint to enforce a strict, predictable gate sequence (e.g., a logical AND) across all hierarchical levels.

    3. Strict Control Plane / Data Plane Decoupling
      Control Plane (Kagenti Operator): Handles source ingestion, external network fetching (OPA bundles, remote Rego/JSON/CEL files, or inline configurations), logic compilation, and merging.
      Data Plane (PDP): Evaluates policies entirely from local memory for maximum resilience and low-latency startup.

    4. 100% Declarative Platform State
      The control plane compiles the final policy state into a local ConfigMap mounted directly by the PDP. This provides platform teams complete visibility into the exact rules and data enforcing decisions at any given moment, eliminating opaque remote state.

    5. Extensible Evaluation Entrypoints
      Policy evaluation is partitioned into distinct execution paths. The initial implementation supports standard network flows (inbound/outbound requests and responses), but the interface is extensible to support future internal queries from collocated PDPs.

  8. changed the title [-]epic: Kagenti OPA - Fine-Grained Authorization for AI Agents[/-] [+]epic: Kagenti OPA/AuthZen - Fine-Grained Authorization for AI Agents[/+] on Jun 23, 2026
  9. changed the title [-]epic: Kagenti OPA/AuthZen - Fine-Grained Authorization for AI Agents[/-] [+]epic: Kagenti OPA - Fine-Grained Authorization for AI Agents[/+] on Jun 23, 2026
  10. changed the title [-]epic: Kagenti OPA - Fine-Grained Authorization for AI Agents[/-] [+]epic: Agent Platform OPA - Fine-Grained Authorization for AI Agents[/+] on Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Identityepic

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions