Skip to content

feature: AuthBroker – Trust-Aware Authorization for Agent → Tool → Resource Flows #922

Closed

Description

@husky-parul

Feature Description

This RFE proposes AuthBroker, a trust-aware authorization framework for AI agent systems where requests flow across multiple trust boundaries: user → agent → tool → resource. The proposal integrates existing identity infrastructure (Keycloak, AuthBridge) with AuthBroker, a dataplane that acts as a Policy Enforcement Point (PEP) at each service boundary. The goal is to enable dynamic, request-level authorization decisions while preserving the existing credential acquisition and verification layers.

1. Problem Statement

1.1. Interaction Model

AI agent systems execute requests across multiple services and tools:

user → agent → tool → resource

Each hop introduces a trust boundary where:

  • Identity must be verified
  • Authorization decisions may be required
  • Delegation context must be preserved

1.2. Current Limitations

Today, authorization logic is implemented through static configuration:

  • Role mappings
  • Scope → audience mappings
  • Token-based access control with fixed audiences

These mechanisms do not support:

  • Restricting which agents can invoke specific tools
  • Restricting which resources a tool may access based on request context
  • Evaluating policy based on runtime attributes (delegation chain, request content, historical behavior)
  • Dynamic descoping of privileges at runtime

1.3. Missing Capabilities

Examples of runtime policy questions that cannot be answered by credentials alone:

  • Has the delegation chain user-Y → agent-A → tool-X been observed before in production?
  • Should this request be denied because the delegation depth exceeds policy limits (e.g., user → agent → agent → agent → tool)?
  • Does this request represent a capability overreach (agent normally reads data, now attempting write)?
  • Should access be blocked because the delegation graph shows anomalous fanout (one agent invoking 20 different tools)?
  • Can tool-X access resource-Z given that the principal's data classification is "sensitive" and the tool's capability card declares "read-only"?

Note: OBO token exchange answers "Can agent-A obtain credentials to act on behalf of user-Y?" AuthBroker answers "Should this specific request proceed given runtime context and policy?"

2. Proposal

2.1. Authorization Layers (Separation of Concerns)

The system involves three distinct layers that should not be conflated:

Layer Mechanism Component Purpose
Credential Acquisition OBO token exchange Keycloak Determines whether a service can obtain credentials to act on behalf of another identity
Credential Verification Token validation, audience verification AuthBridge Ensures the presented credential is valid and has the correct audience
Authorization Runtime policy evaluation (allow / deny) AuthBroker Determines whether a specific request should proceed given context, delegation chain, and policy

Key insight: A service may have valid credentials (layers 1 & 2 pass) but still be denied by policy (layer 3). Example: agent-A has a valid OBO token for tool-X, but AuthBroker denies because the delegation pattern user-Y → agent-A → tool-X has never been observed before and violates anomaly detection policy.

2.2. Role of AuthBroker

AuthBroker focuses on runtime request enforcement at service boundaries.

In this model:

  • AuthBroker acts as a PEP at hop boundaries
  • Verified identity and request context are evaluated before forwarding requests
  • Policy decisions are made by querying pluggable Policy Decision Points (PDPs)

Example checks:

  • agent → tool allowed?
  • tool → resource allowed?
  • Does the delegation chain match expected patterns?
  • Are there anomaly signals (novel edge, depth exceeded, capability overreach)?

Key principle: AuthBroker does not replace token exchange. Instead, it consumes the credentials issued by the identity layer and uses them as inputs for policy evaluation.

2.3. Architecture

┌─────────────┐
│   User      │
└──────┬──────┘
       │ [1] Request + credentials
       ▼
┌─────────────────────────────────────────┐
│  Ingress Gateway (PEP)                  │
│  - Extract principal identity           │
│  - Stamp trust headers (x-principal-id) │
│  - Query PDP: allow ingress?            │
└──────┬──────────────────────────────────┘
       │ [2] Forwarded with trust headers
       ▼
┌─────────────────────────────────────────┐
│  Agent Service + Sidecar (PEP)          │
│  - Validate token (AuthBridge)          │
│  - Query PDP: agent → tool allowed?     │
│  - Emit trust-tagged span               │
└──────┬──────────────────────────────────┘
       │ [3] Delegated request
       ▼
┌─────────────────────────────────────────┐
│  Tool Service + Sidecar (PEP)           │
│  - Validate token (AuthBridge)          │
│  - Query PDP: tool → resource allowed?  │
│  - Emit trust-tagged span               │
└──────┬──────────────────────────────────┘
       │ [4] Resource access
       ▼
┌─────────────────────────────────────────┐
│  Resource (database, API, etc.)         │
└─────────────────────────────────────────┘

Telemetry Path:
All sidecars → OTel Collector → Trace Backend → Lineage Service

2.4. Trust Headers

Headers propagated through the delegation chain:

Header Mutability Purpose
x-principal-id Immutable Original user identity (set once at ingress)
x-request-id Immutable Request correlation ID
x-caller-id Mutable Current caller identity (updated at each hop)
x-caller-type Mutable Type of caller (user, agent, tool)
x-trust-hop-kind Mutable Type of delegation (invoke, delegate, access)
x-trust-target Mutable Target service for current hop

2.5. Policy Decision Points (PDPs)

AuthBroker integrates with pluggable PDPs:

  1. OPA (Open Policy Agent): Rule-based policies on trust headers and request attributes
  2. Trust Score Engine: Real-time risk scoring based on delegation graph anomalies
  3. External PDPs: Any system speaking standard authorization callout protocols (AuthZen, ext_authz)

Decision Combiner: Aggregates decisions from multiple PDPs (all must allow, or configurable quorum).

Additional Context

1. Existing Components

1.1. Identity / Credential Layer

Keycloak provides:

  • OAuth token issuance
  • Token exchange (OBO / delegation) for downstream service credentials

1.2. AuthBridge

Acts as a Policy Enforcement Point (PEP):

  • Validates incoming tokens
  • Verifies audience claims
  • Performs token exchange via Keycloak
  • Forwards requests to downstream services

Current limitation: Policy enforcement is limited to accepting valid tokens with the correct audience. No request-level authorization logic.

2. Design Details

2.1. Request Lifecycle

  1. Ingress Gateway:

    • Extract principal identity from OAuth token
    • Stamp immutable trust headers (x-principal-id, x-request-id)
    • Query PDP: "Allow principal X to invoke system?"
    • Forward request with trust headers
  2. Agent Sidecar (Outbound):

    • Validate token via AuthBridge (credential verification)
    • Query PDP: "Allow agent A to invoke tool T on behalf of principal P?"
    • If allowed: mutate trust headers (x-caller-id=A, x-trust-target=T)
    • Emit trust-tagged span with delegation context
    • Forward request
  3. Tool Sidecar (Inbound):

    • Receive request with trust headers
    • Validate token via AuthBridge
    • Query PDP: "Allow this delegation chain to access tool T?"
    • Emit trust-tagged span (inbound hop)
  4. Tool Sidecar (Outbound → Resource):

    • Query PDP: "Allow tool T to access resource R given delegation context?"
    • Emit trust-tagged span
    • Forward to resource

2.2. Trust-Tagged Spans

Each sidecar emits OpenTelemetry spans with tags:

{
  "trust.source": "agent-A",
  "trust.target": "tool-T",
  "trust.hop_kind": "invoke",
  "trust.run_id": "550e8400-e29b-41d4-a716-446655440000",
  "trust.principal_id": "[email protected]"
}

2.3. Lineage Service

Queries the trace backend and reconstructs the delegation DAG:

  • Topologically ordered event list (causal chain)
  • DAG with nodes (actors) and edges (delegations)
  • Provenance queries: "Why did tool T access resource R?"
  • Risk scoring: novel edges, depth anomalies, capability overreach

2.4. Integration with AuthBridge

AuthBridge responsibilities (unchanged):

  • Token validation
  • Audience verification
  • Token exchange for downstream services

AuthBroker PEP responsibilities (new):

  • Policy evaluation at request time
  • Trust header propagation
  • Span emission for lineage reconstruction

Interaction: AuthBridge performs credential verification. AuthBroker consumes the verified credential and uses it as input for authorization policy evaluation.

Activity

  1. mrsabath commented on Mar 13, 2026

    @mrsabath
    Member

    Design Review: AuthBroker — Trust-Aware Authorization (2 rounds, converged)

    Adversarial design review of the AuthBroker proposal. Two perspectives (Cloud Native Security Architect + SRE/Security Red Team) iterated over 2 rounds. Updated with analysis of recent PRs across both kagenti/kagenti and kagenti/kagenti-extensions.

    Key Insight: Build on In-Flight Infrastructure

    The review identified that several in-flight PRs already provide the cryptographic delegation chain and config infrastructure that AuthBroker needs. The revised design pivots from a header-propagation framework to a focused claim-based policy engine built on existing foundations.

    PR Repo What it provides for AuthBroker
    #231 extensions RFC 8693 actor token with nested act claims in JWT — cryptographically signed delegation chain
    #916 kagenti SPIFFE identity for workloads — cryptographic caller identity
    #217 extensions Per-workload config resolution + AgentRuntime CR — policy config delivery
    #668/#119 both OTel-enhanced ext_proc — telemetry foundation for async analysis
    #758 kagenti Agent sandbox (Landlock, Squid proxy) — parallel network/kernel security layer

    Issues Found and Resolved

    # Issue Severity Resolution
    C1 Trust headers spoofable — AND redundant with act claim chaining (PR #231) Critical Pivot to JWT act claims as primary delegation context. Reduce headers from 6 to 2: x-request-id (existing) + x-trust-hop-kind (new). Everything else from signed JWT.
    C2 Lineage Service conflates observability with authorization — trace backend becomes authz dependency Critical Separate synchronous policy (in-process, local) from async analysis (CronJob, advisory). Authorization never blocks on trace backend.
    C3 No concrete PEP implementation — where does it run? Critical PEP runs inside existing AuthBridge ext_proc binary. No new sidecar. Leverages PR #217 config resolution.
    M1 6 trust headers = adoption barrier Major Reduced to 2 headers. Core delegation chain from JWT act claims.
    M2 OPA is a new dependency with zero presence in platform Major No OPA for v1. Istio AuthorizationPolicy (SPIFFE) + in-process Go rules. OPA opt-in per-workload in v2.
    M3 Delegation chain data model undefined for graph queries Major Linear chain from act claims (synchronous). Graph queries via async Trust Analyzer CronJob.
    M4 Latency budget unaddressed Major In-process policy: ~0.1-0.5ms. No remote PDP calls in v1.
    M5 PEP vs ext_proc ordering undefined Major PEP evaluates after token exchange — uses exchanged token's act claims.
    M6 No coordination with Agent Sandbox (PR #758) Major Three-layer model: kernel (Landlock) -> network (Squid/NetworkPolicy) -> application (AuthBroker). Complementary, both configurable via AgentRuntime CR.

    Revised Authorization Layers

    Layer Mechanism Component Status
    Credential Acquisition OBO token exchange with actor token Keycloak + AuthBridge Exists (PR #231)
    Credential Verification JWT validation, audience, act chain AuthBridge ext_proc Exists
    Network Authorization SPIFFE identity + Istio AuthorizationPolicy Istio Ambient + SPIRE Exists (PR #916)
    Application Authorization act claim-based policy evaluation AuthBroker PEP (ext_proc extension) New
    Async Trust Analysis Delegation graph anomaly detection Trust Analyzer (CronJob) New

    Policy Configuration via AgentRuntime CR

    apiVersion: agent.kagenti.dev/v1alpha1
    kind: AgentRuntime
    metadata:
      name: summarizer-agent
      namespace: team1
    spec:
      authBridge:
        enabled: true
        routes:
          - host: "github-tool-mcp"
            target_audience: "github-tool"
        policy:
          maxDelegationDepth: 3
          allowedEdges:
            - caller: "spiffe://cluster.local/ns/team1/sa/summarizer-agent"
              target: "github-tool-mcp"
              hopKind: invoke
          inbound:
            allowPrincipals: ["[email protected]", "orchestrator-agent"]

    Revised ext_proc Flow (Outbound)

    1. Receive request headers from Envoy
    2. Resolve route from routes.yaml
    3. Token exchange with actor_token (PR #231) -> JWT with nested act claims
    4. -- NEW -- Extract act chain from exchanged JWT
    5. -- NEW -- Evaluate policy (in-process, ~0.1ms):
       a. Depth check: len(act chain) <= maxDelegationDepth?
       b. Edge check: (caller, target, hopKind) in allowedEdges?
       c. Capability check: required scopes present?
    6. DENY -> 403 ImmediateResponse | ALLOW -> forward with exchanged token
    

    Architecture Diagram

                        +----------------------------------------------+
                        |                  Agent Pod                    |
                        |                                              |
                        |  +----------+       +---------------------+  |
                        |  |  Agent   |------>|  Envoy ext_proc     |  |
                        |  |Container |       |  (AuthBridge +       |  |
                        |  +----------+       |   AuthBroker PEP)   |  |
                        |                     |                     |  |
                        |                     |  1. Route resolve    |  |
                        |                     |  2. Token exchange   |  |
                        |                     |     (actor_token)    |  |
                        |                     |  3. Extract act chain|  |
                        |                     |  4. Evaluate policy  |  |
                        |                     |  5. ALLOW / DENY     |  |
                        |                     +---------------------+  |
                        +----------------------------------------------+
                                              |
                                  OTel spans  |  (async, non-blocking)
                                              v
                        +----------------------------------------------+
                        |  Trust Analyzer (CronJob, advisory only)     |
                        |  - Build delegation graph from spans          |
                        |  - Detect: novel edges, fanout, depth anomaly|
                        |  - Update deny-list ConfigMap (advisory)      |
                        +----------------------------------------------+
    
    Policy: AgentRuntime CR -> webhook -> authbroker-policy ConfigMap -> ext_proc (fsnotify)
    Network: Istio AuthorizationPolicy (SPIFFE) + NetworkPolicy (sandbox)
    Kernel:  Landlock + seccomp (agent sandbox PR #758)
    

    Implementation Phases

    Phase Scope Depends on Size
    0 Prerequisites: merge PRs #231, #916, #217 -- In-flight
    1 act chain extraction in go-processor Phase 0 ~50 lines Go
    2 Policy struct + in-process evaluation Phase 1 ~150 lines Go
    3 Policy config via AgentRuntime CR -> ConfigMap Phase 0 (#217) ~80 lines Go
    4 Inbound PEP (validate act chain) Phase 2 ~50 lines Go
    5 x-trust-hop-kind header + Istio AuthorizationPolicy templates Phase 2 ~60 lines
    6 Trust Analyzer CronJob (batch analysis) PR #668 ~300 lines
    7 OPA integration (optional, v2) Phase 2 ~100 lines Go

    Key Design Decisions

    # Decision Rationale
    D1 JWT act claims as primary delegation context (not headers) Cryptographically signed, non-spoofable, already in-flight (PR #231)
    D2 2 headers instead of 6 Only x-request-id + x-trust-hop-kind; rest from JWT
    D3 PEP inside existing ext_proc, no new sidecar Zero additional containers, leverages existing infra
    D4 In-process Go rules for v1 (no OPA) ~0.1ms evaluation, no new dependencies
    D5 Istio AuthorizationPolicy for network-layer authz Leverages SPIFFE identity (PR #916), no new components
    D6 Trust Analyzer as async CronJob, advisory-only Never blocks authorization on telemetry pipeline
    D7 Policy via AgentRuntime CR Single source of truth, leverages PR #217 config resolution
    D8 Three-layer security: kernel -> network -> application Clear separation with Agent Sandbox (PR #758)
    D9 fsnotify for policy hot-reload Enables Trust Analyzer updates without pod restart
    D10 OPA opt-in per-workload in v2 Complex policies when allow-lists are not sufficient

    Open Items (non-blocking)

    • Validate Keycloak act-claim-spi nesting depth — if limited, constrains maxDelegationDepth
    • Define x-trust-hop-kind semantics — invoke (agent->tool), delegate (agent->agent), access (tool->resource)
    • Wildcard patterns for allowedEdges — glob matching on SPIFFE IDs for large deployments
    • Trust Analyzer graceful degradation — no-op when Phoenix is disabled (PR feat: Make Phoenix (observability) an optional component #913)

    Design review by Claude Code — 2 rounds, 10 issues found, all resolved. Zero Critical/Major remain. Updated with analysis of PRs #231, #916, #217, #668, #758, #233.

  2. maia-iyer commented on Mar 17, 2026

    @maia-iyer
    Contributor

    I'm confused architecturally how AuthBroker and AuthBridge are to be deployed. Are they both going to live in the same sidecar?

    I am +1 for developing the authz story in Kagenti, but I've been of the belief that AuthBridge is a PEP and needs to itself evolve to plug with other PDPs. I'm currently curious why AuthBroker should be a separate PEP (does Authbridge cease to be a PEP?).

  3. Onechan commented on Mar 17, 2026

    @Onechan

    The AuthBroker design maps closely to something we've been shipping at nornr.com. We focus specifically on spend authorization: agents request a mandate before any action that costs money, policy engine decides approved/queued/blocked, and every decision gets a signed receipt. Your user to agent to tool to resource flow is exactly the chain we instrument. Happy to compare notes on how our mandate model handles the trust boundary crossings you describe.

  4. added
    Identity
    on Apr 29, 2026
  5. pdettori commented on Jul 17, 2026

    @pdettori
    Member

    closing as no longer in scope of the project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Identity

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions