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:
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
async with sourcerykit.async_intercept_context(agent_id="demo", action_name="get_data"):
async with httpx.AsyncClient() as client:
response = await client.get(
"https://api.example.com/data",
params={"query": "example_parameter"}
)
data = response.json()For details on managing allowed destinations, see trusted endpoints. To see how these logs are used to verify claims, see architecture.