The Interceptor acts as an automated network recorder and policy enforcer for Python agents. It hooks into outbound HTTP calls to ensure every network interaction is observed, verified, and audited without requiring modifications to your application's core logic.
The Interceptor patches popular Python HTTP libraries (including httpx, aiohttp and requests) to evaluate and record network traffic:
intercepts database table, creating a tamper-evident audit trail for proof generation.Initialize the SDK at application startup to automatically enable global HTTP interception:
import sourcerykit
import httpx
# Initialize runtime, database schema, and interceptors
await sourcerykit.bootstrap_system()
# Intercept and tag outbound network activity — returns a unique ref
async with sourcerykit.async_intercept_context(agent_id="demo", action_name="get_data") as ref:
async with httpx.AsyncClient() as client:
response = await client.get(
"https://api.example.com/data",
params={"query": "example_parameter"}
)
data = response.json()
# Return ref alongside data so the agent can map claims to this intercept
return {**data, "sourcerykit_ref": ref}agent_id and action_name) directly to outbound requests, mapping raw network traffic to specific agent actions.For details on managing allowed destinations, see trusted-endpoints. To see how these logs are used to verify claims, see architecture.