Skip to content

Policy Engine

All policy decisions in TapPass are made by Open Policy Agent (OPA). a CNCF-graduated policy engine running as a sidecar. TapPass enforces OPA’s decisions. It has no built-in policy logic.

If OPA is unreachable, all requests are denied. No request is ever forwarded unscanned.

ModulePathPurpose
authz.regotappass/authzRBAC: who can access what endpoint
pipeline.regotappass/pipelinePipeline step config per agent/org
tools.regotappass/toolsTool permissions: allow/deny per agent
routing.regotappass/routingModel routing: classification → allowed models
breakglass.regotappass/breakglassEmergency override authorization
guardrails.regotappass/guardrailsDetection response: block vs redact vs notify

After the pipeline passes, TapPass mints an ES256-signed capability token:

  • Time-bounded: 60s default TTL
  • Action-scoped: lists allowed tools and operations
  • Identity-bound: cryptographically bound to agent’s SPIFFE ID
  • Constraint-carrying: embeds argument restrictions
  • Verifiable offline: ~27μs via JWKS at /.well-known/jwks.json
  • Decision caching: LRU with 30s TTL, 10K entries
  • Sub-millisecond latency: sidecar deployment
  • Audit logging: every decision logged with OPA decision ID

Test new policies against historical events without affecting production:

# Replay last 1000 events with a new policy
results = tp.policy_replay("new-policy-v2", events=1000)
print(f"Would have blocked {results.blocked_count} additional requests")