Skip to content

Runtime Governance Reference

Everything the SDK exposes for runtime governance.

from tappass import Agent, AsyncAgent

Agent(url, api_key, *, model="gpt-4o-mini", respect_breakglass=False, raise_on_redaction=False) — sync governed agent. AsyncAgent(url, *, api_key="", ...) — async variant.

.chat(prompt, *, model=None, metadata=None) -> ChatResponse. .stream(prompt, ...) -> Iterator[ChatChunk] / AsyncIterator[ChatChunk].

Both return responses with correlation IDs: .session_id, .task_id, .agent_uuid, .pipeline_uuid, .audit_url.

from tappass import tappass_session, tappass_session_async, current_session

with tappass_session(url=..., api_key="tp_...") as session: opens a server session, pushes correlation IDs into a ContextVar. Nested Agent.chat() and govern()-wrapped tool calls inherit automatically. current_session() returns the active Session or None.

TapPassError
├── TapPassConnectionError
├── TapPassConfigError
└── GovernanceDecision
├── PolicyBlockError .blocked_by, .classification
├── RedactionApplied .redactions, .redacted_content
├── ApprovalRequired .approval_url, .resume_token, .expires_at
├── TrustTierDenied .required_tier, .actual_tier
├── BreakGlassActive .level, .expires_at
└── ToolIntegrityViolation .tool_name, .violation

Every GovernanceDecision carries .session_id, .task_id, .agent_uuid, .pipeline_uuid, .audit_url — deep-link to the dashboard or correlate in audit API queries.

FrameworkSyncAsyncUnit of work
CrewAIguard_crewguard_crew_asynccrew.kickoff()
LangChainguard_agentguard_agent_asyncexecutor.invoke()
OpenAI Assistantsguard_openai_runguard_openai_run_asyncone run
Google ADKguard_adk_agentguard_adk_agent_asyncagent.run()
Temporal@governed_workflowsameone workflow execution
MCP clientguard_mcp_clientconnection lifetime
MCP serverTapPassMCPMiddlewaresameper-request
A2Awith_correlation / join_correlationsameno session owner
FastAPITapPassMiddlewaresameper-request
from tappass import govern
tools = govern([my_tool_fn], url=..., api_key="tp_...")
# Each tool invocation emits an AuditEvent with correlation from the
# active tappass_session (if any).
from tappass import TapPass
with TapPass("https://tappass.example.com", admin_key="tp_...") as tp:
h = tp.health() # server health / version
agent = tp.agent(agent_uuid) # lookup
cred = tp.register_agent("my-service", framework="langchain")

Dashboard-level admin (policy CRUD, compliance reports, retention, break-glass invocation, Verified credential issuance, trust management) is NOT in the SDK. Use the web UI.