spt-txn-pep

module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: Apache-2.0

README

SPT-Txn — enforcement points

Zero dependencies. Chain-agnostic. One Wrap().

Per-transaction authorization and a tamper-evident audit trail for any HTTP resource server or MCP tool server. go.mod has no require block: this module depends on nothing but the Go standard library, and it is going to stay that way.

pep := &gateway.PEP{ /* ... */ }
http.ListenAndServe(":8080", pep.Wrap(yourHandler))

Every request is authorized against a declared transaction, a signed transparency-log entry is emitted, and the request reaches the protected resource only on ALLOW.

⚠️ Conformance gap, being fixed. The IETF draft requires a PEP to emit a Transaction Receipt — a JSON object carrying PEP identity, decision class, rule path, policy hash, jurisdiction and nonce. This module currently emits a translog entry, which is the transparency-log half of that specification section, not the receipt. The receipt implementation lives in spt-txn-poc and is not yet reachable from here. See translog's package documentation.

What's here

Package What it does
gate The decision core: offline intent binding, ALLOW / DENY_VIOLATION / DENY_UNAVAILABLE
translog Hash-chained log records + RFC 6962 Merkle transparency log (not the spec Transaction Receipt — see package doc)
gateway HTTP PEP — PEP.Wrap(http.Handler) middleware, plus a transparency-log HTTP service
mcpgate MCP PEP — the same decision core enforcing agent tool calls

Both enforcement points call the same gate. Neither holds policy logic of its own.

Why this is a separate module

These packages were extracted from spt-txn-x402-solana, where adopting the middleware meant pulling solana-go and ~28 indirect dependencies — a blockchain SDK and a Mongo driver — into the dependency graph of anyone who only wanted per-transaction authorization.

SPT-Txn is chain-agnostic. This module makes that structural rather than asserted: the dependency direction runs one way, from chain-specific consumers to this module, never back. If anything here ever needs a chain, the claim is gone.

Licence and scope

Apache-2.0. Enforcement points are free — running one costs nothing, and it always will. What is commercial is operating a fleet of them and proving compliance with them: the control plane (issuer registry, revocation distribution, trust-snapshot hosting), receipt aggregation and retention, control mappings and compliance packs.

Security features are never gated. Verifying a status list and pinning a trust snapshot are free; hosting and distributing them at fleet scale is not.

Specification

draft-coetzee-oauth-spt-txn-tokens-03 — https://datatracker.ietf.org/doc/draft-coetzee-oauth-spt-txn-tokens/

Datatracker is the single source of truth for the draft version.

Reference implementation: https://github.com/rudizee007/spt-txn-poc

Status — read this before relying on it

Proof of concept. Not externally audited. Not for production use.

On the project's assurance ladder these packages sit at tested and adversarially reviewed; independent audit and production hardening are the next steps, and neither has happened. "Adversarially reviewed" here means AI-agent review plus the maintainer's own analysis — not an assessment by an independent security firm.

Contributing

Trust-boundary changes (the decision path, intent binding, receipt signing) are reviewed spec-first and adversarially before merge. Please open an issue describing the gap before sending a PR that touches gate or translog.

Do not add a third-party dependency to this module without discussion. The absence of one is a feature, not an oversight.

Directories

Path Synopsis
Package evidence defines how a PEP emits a spec Transaction Receipt.
Package evidence defines how a PEP emits a spec Transaction Receipt.
Package gate implements the SPT-Txn x402 payment gate: it decides ALLOW/DENY for an x402 payment BEFORE any transaction is signed.
Package gate implements the SPT-Txn x402 payment gate: it decides ALLOW/DENY for an x402 payment BEFORE any transaction is signed.
Package gateway is a drop-in x402 authorization enforcement point (PEP): wrap any http.Handler and it enforces the SPT-Txn decision on every request, emits a signed transparency-log entry, and forwards to the protected resource only on ALLOW.
Package gateway is a drop-in x402 authorization enforcement point (PEP): wrap any http.Handler and it enforces the SPT-Txn decision on every request, emits a signed transparency-log entry, and forwards to the protected resource only on ALLOW.
Package mcpgate enforces SPT-Txn authorization on AI-agent tool-calls — the MCP policy-enforcement-point profile.
Package mcpgate enforces SPT-Txn authorization on AI-agent tool-calls — the MCP policy-enforcement-point profile.
Package translog implements the SPT-Txn TRANSPARENCY LOG: a signed, hash-chained, fixed-width record per authorization decision, appended to an append-only log whose RFC 6962 Merkle root can be anchored on-chain.
Package translog implements the SPT-Txn TRANSPARENCY LOG: a signed, hash-chained, fixed-width record per authorization decision, appended to an append-only log whose RFC 6962 Merkle root can be anchored on-chain.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL