Skip to content

Architecture

TapPass sits between your AI agents and LLM providers. Every request passes through a governance pipeline before reaching the LLM, and every response is scanned before reaching the agent.

graph LR
subgraph Agents
A1[Agent 1]
A2[Agent 2]
A3[Agent N]
end
subgraph TapPass Gateway
GW[Gateway]
PP[Pipeline<br/>49 steps]
PA[Policy Engine<br/>OPA]
AU[Audit Trail<br/>Hash chain]
ID[Identity<br/>RBAC + SPIFFE]
VT[Vault<br/>Credentials]
end
subgraph LLM Providers
OAI[OpenAI]
ANT[Anthropic]
AZ[Azure OpenAI]
GEM[Google Gemini]
end
A1 -->|tp_ key| GW
A2 -->|tp_ key| GW
A3 -->|tp_ key| GW
GW --> PP
PP <--> PA
PP --> AU
GW <--> ID
GW --> VT
VT -->|sk_ key| OAI
VT -->|sk-ant_ key| ANT
VT -->|Azure key| AZ
VT -->|Google key| GEM

TapPass acts as a transparent proxy between your agents and LLM providers. Your agents talk to TapPass using an OpenAI-compatible API; TapPass talks to the real provider using the provider’s API key.

Your Agent TapPass Gateway LLM Provider
│ │ │
│ POST /v1/chat/ │ │
│ completions │ │
│ Authorization: │ │
│ Bearer tp_abc123 │ │
│ ─────────────────────► │ │
│ │ 1. Authenticate agent │
│ │ 2. Run 49-step pipeline│
│ │ 3. Policy check (OPA) │
│ │ 4. Resolve credentials │
│ │ │
│ │ POST /v1/chat/ │
│ │ completions │
│ │ Authorization: │
│ │ Bearer sk-abc123 │
│ │ ──────────────────────► │
│ │ │
│ │ ◄────── response ───── │
│ │ │
│ │ 5. Scan response │
│ │ 6. Audit log │
│ ◄──── response ────── │ │
│ │ │

This means:

  • Provider keys stay on the server. Agents never see sk-... keys.
  • Governance is enforced server-side. Agents cannot bypass the pipeline.
  • Key rotation is centralized. Rotate one place, all agents updated.
  • Per-agent policies. Different agents can have different model access, budget caps, and data policies.

Every request and response passes through a configurable pipeline of governance steps. Steps run in order. Each step can inspect, modify, or block the request.

The pipeline is organized into phases:

Pre-LLM steps (before the request reaches the provider)

Section titled “Pre-LLM steps (before the request reaches the provider)”
CategoryStepsWhat they do
Input validationvalidate_input, posture_checkSchema validation, agent posture verification
Data protectiondetect_pii, detect_secrets, pii_tokenizeFind and redact PII, API keys, passwords
Threat detectiondetect_injection, detect_exfiltration, detect_escalation, detect_flooding, detect_social_engineering, detect_insider_threat, detect_boundary_escape, detect_unicode, detect_memory_poisonPrompt injection, data exfiltration, privilege escalation, social engineering
Tool governancefilter_tools, tool_permissions, tool_constraints, scan_tool_calls, verify_tool_governance, taint_checkRestrict tool access, enforce constraints, verify capability tokens
Content safetycontent_safety, classify_data, inspect_images, detect_multimodalContent moderation, data classification, image analysis
Rate limitingrate_limit, budget_enforcement, session_budgetPer-agent and per-org rate limits, token budgets
Session controlssession_escalation, session_loop_guard, loop_guardDetect agent loops, escalation patterns
Infrastructuremodel_routing, detect_infra, detect_code_exec, shell_bleedModel selection, infrastructure protection

The call_llm step forwards the (potentially modified) request to the LLM provider through the credential vault.

Post-LLM steps (before the response reaches the agent)

Section titled “Post-LLM steps (before the response reaches the agent)”
CategoryStepsWhat they do
Output scanningscan_output, scan_tool_results, redact_tool_resultsScan responses for PII, secrets, policy violations
Integrityverify_claims, verify_artifact, dedup_outputVerify factual claims, check artifact integrity, deduplication
Restorationpii_restore, constrain_outputRestore tokenized PII for authorized consumers, format constraints

Every step can be configured per-organization through policy:

{
"steps": {
"detect_pii": {
"enabled": true,
"on_detection": "redact",
"threshold": 0.8
},
"rate_limit": {
"enabled": true,
"max_calls": 100,
"window_seconds": 3600
}
}
}

Steps have four actions on detection: block (stop the request), redact (remove the sensitive content), notify (log and continue), or allow (skip).

Capability tokens are signed, time-bound tokens that specify exactly what tools an agent can use and with what constraints. They implement the principle of least privilege for AI agent tool calls.

  1. The control plane issues a token — specifying which tools, what constraints, and for how long.
  2. The agent receives the token — attached to its session or passed per-request.
  3. Tool executors verify offline — ~27 microseconds, no server round-trip needed.
PropertyDescription
Proof-of-Possession (PoP)Stolen tokens are useless without the holder’s private key
Monotonic attenuationDelegated tokens can only narrow permissions, never expand them
Offline verificationEd25519 signature check, no network call required
Rich constraintsSubpath, URL-safe, pattern matching, range limits, CEL expressions
Delegation chainsUp to 64 levels of cryptographically verified delegation
Trust scoresAgent reputation (0-1000) embedded in the token
Clearance levelsUNTRUSTED, EXTERNAL, PARTNER, INTERNAL, PRIVILEGED, SYSTEM
┌─────────────────────────────────────────────┐
│ Capability Token (tp_ct_...) │
├─────────────────────────────────────────────┤
│ issuer: Ed25519 public key (32 bytes) │
│ holder: Ed25519 public key (32 bytes) │
│ tools: { "read_file": constraints } │
│ clearance: INTERNAL (30) │
│ trust_score: 750 │
│ expires_at: 1711500000 │
│ depth: 0 (root) / 1..64 (delegated) │
│ parent_hash: SHA-256 link to parent token │
├─────────────────────────────────────────────┤
│ signature: Ed25519 over payload │
└─────────────────────────────────────────────┘
from tappass.capability_token import Authorizer, PublicKey
authorizer = Authorizer(trusted_roots=[control_plane_pubkey])
result = authorizer.check(token, "read_file", {"path": "/data/report.txt"}, pop_sig)
if result.authorized:
# Execute the tool call
...
else:
print(result.reason) # "Tool 'read_file' not authorized"

TapPass computes a health score for every agent based on its historical behavior. The score is computed from the audit trail — no new instrumentation needed.

DimensionWeightWhat it measures
Compliance30%Pass rate without blocks
Data Safety25%PII and secret handling
Security20%Threat detection rate
Stability15%Behavioral consistency
Efficiency10%Cost management
  • Capability token clearance. Trust score maps to clearance level — agents with scores below 200 get UNTRUSTED clearance, limiting tool access.
  • Adaptive thresholds. Detection steps can use trust score to adjust sensitivity — trusted agents get lower false-positive rates.
  • Dashboard visibility. The /agents/{agent_id}/health endpoint returns the score, grade (A-F), trend, and alerts.
Score rangeClearanceMeaning
950-1000SYSTEMFully autonomous operation
800-949PRIVILEGEDTrusted, minimal oversight
600-799INTERNALStandard operation
400-599PARTNERLimited tool access
200-399EXTERNALRestricted, monitored
0-199UNTRUSTEDNo tool access, observe only