SXP — Scoped Execution Protocol

Guarded tool execution with Python and TypeScript SDKs and adapters for MCP, A2A, and AG-UI.

Three-Primitive Thin Waist

HandleStore (REF#) SHA-256 addressing that binds data, policy, taint, and expiry with deterministic receiver-side L0 summaries, lazy L1 views, chunked L2 reads, synced LRU eviction, ephemeral RAM-only isolation, and purge().
Guarded Call Boundary 7-field CoreEnvelope, CAS PreviewLease, idempotency_key, LIFO undo, HMAC-SHA256 $sig wire auth, ReplayGuard, and tamper-evident Merkle audit chain.
3-Mode Projection Prefix-cache-safe standard, compact, and flat modes supporting frontier models and 1B–8B System 1 models with zero-copy spawn_system2_escalation().

Local Measurements

The example reports upfront and deferred tool discovery sizes, compares rails elision at equal compression settings, and measures in-process Python call time.

Run the benchmark example

Quickstart

python -m pip install "https://github.com/matthewmajo/sxp/releases/download/v1.0.0/scoped_execution_protocol-1.0.0-py3-none-any.whl"
python3 -m sxp host-config --host cursor --config upstream.mcp.json
from sxp import AgentKernel, AppConnector, EffectClass, HardRail

app = AppConnector("notes", summary="Local markdown notes", untrusted=False)

@app.tool(effect=EffectClass.READ)
def search_notes(query: str, limit: int = 5):
    return {"query": query, "limit": limit}

kernel = AgentKernel(rails=[HardRail.require_preview_for_writes(), HardRail.block_tainted_egress()])
kernel.connect_app(app)

Resources