feat(authz): add standalone authorization service - #2395
Open
sriaradhyula wants to merge 14 commits into
Open
Conversation
Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
Contributor
|
✅ No proprietary content detected. This PR is clear for review! |
Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
Implement the first additive exact-tool expression-policy slice across the OpenFGA model, ext_authz bridge, deployment configuration, documentation, and real OpenFGA E2E coverage. Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
sriaradhyula
marked this pull request as ready for review
August 18, 2026 03:45
Document the intentional health-check retry that Code Quality flagged as an empty exception handler. Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Architecture and rollout discussion: Introducing caipe-authz — Discussion #2406. Please use the discussion for design feedback and this PR for implementation review.
Summary
Introduces
caipe-authz, a standalone Python authorization service that CAIPE can adopt without replacing the existing BFF and AgentGateway authorization paths in one release.This PR delivers:
ext_authzgRPC authorization APIs.LEGACY,SHADOW,CANARY,AUTHZ, andAUTHZ_ONLYmodes.Why
Authorization is currently evaluated in more than one runtime. Adding conditional policy directly to those paths would duplicate context construction, policy behavior, audit semantics, and rollback logic.
caipe-authzprovides one policy decision point while preserving the existing paths during migration.Architecture
flowchart LR BFF["CAIPE BFF"] --> BR["BFF migration router"] GW["Envoy / AgentGateway"] --> GR["Gateway migration router"] BR --> LEGACY["Existing evaluators"] GR --> LEGACY BR --> AUTHZ["caipe-authz"] GR --> AUTHZ AUTHZ --> CONTEXT["Trusted context construction"] AUTHZ --> POLICY["Typed policy templates"] CONTEXT --> FGA["OpenFGA relationships + CEL"] POLICY --> FGA AUTHZ --> AUDIT["Durable audit outbox"] AUDIT --> AUDITSVC["Audit Service"] AUTHZ --> INSPECT["Sanitized inspection graph"] AUDITSVC --> UI["CAIPE admin comparison UI"] INSPECT --> UIcaipe-authzserviceext_authzgRPCcaipe-authzParallel migration
BFF and gateway scopes move independently. A routing-mode change never writes or deletes OpenFGA tuples.
LEGACYSHADOWcaipe-authzcompared asynchronouslyCANARYAUTHZcaipe-authzAUTHZ_ONLYcaipe-authzPromotion is blocked unless the scope has explicit evidence for:
AUTHZ_ONLYbefore legacy retirement.Conditional-policy lifecycle
caipe-authzvalidates schema pins and reconciles condition constants on OpenFGA tuples.caipe-authzconstructs bounded trusted context and OpenFGA evaluates the condition.Expression enforcement stays unavailable until the exact caller and agent-tool scopes are Authz-authoritative and have an owner, pinned model descriptor, and trusted schema hash.
Safety and rollback invariants
AUTHZ_ONLYnever calls the legacy evaluator.Admin UI and inspection
The existing CAIPE admin surfaces now include:
caipe-authzdecisions, reasons, provider codes, errors, and durations.Verification
v1.15.1; 87.69% coverage.LEGACY → SHADOW → CANARY → AUTHZ → AUTHZ_ONLY, routing rollback, and policy rollback using a realcaipe-authzgRPC server and OpenFGA container.git diff --checkpassed.The implementation also fixed two integration defects found by live testing: OpenFGA unfiltered reads no longer send an invalid empty tuple key, and read page sizes are capped at the server-supported limit.
Deliberately deferred
Physical removal of the legacy authorization paths is not part of this PR. It is permitted only after deployed scopes complete the
AUTHZ_ONLYretention window and satisfy the rollback-release gate.The remaining SpecKit items are:
Type of Change
Checklist