OnchainOS / agent operator
Delegate a reviewable marketplace task
The operator still reviews task creation, the x402 spend, the returned result, completion, and any feedback.
Catalog-backed prompt not available.
Developer quickstart
Scan untrusted output immediately before a model, tool, wallet, or outbound request uses it. Handle ALLOW, SANITIZE, and BLOCK explicitly.
Identify the untrusted text immediately before a model, tool, wallet, or outbound request consumes it.
Use the repository packages below; no PyPI or npm publication is claimed.
ALLOW uses the original under caller policy, SANITIZE uses only the returned transformed text after review, and BLOCK stops the action.
Exercise BLOCK plus a timeout before shipping; enforcement should fail closed.
Install the Python service and SDK from this repository. The package
currently named
warden-guard on PyPI is unrelated, so Warden does not
publish a PyPI install command here.
python -m pip install -e . -e sdk/python
Local mode runs WardenEngine in the caller's process. It
has no network dependency or hosted quota, fails closed, returns
sanitized text for SANITIZE, and raises
WardenBlocked for BLOCK.
from warden_guard import WardenClient
safe = WardenClient(local=True, fail_open=False).guard(untrusted_text)
WardenClient() calls /api/demo/scan with
fail_open=True. That route is best-effort telemetry,
not enforcement: the current default quota is 20 requests per minute
per IP, depth is forced to fast, payloads are truncated
to 4,000 characters, and hosted latency includes network round-trip
time.
warden = WardenClient() # hosted free default; fail_open=True
result = warden.scan(untrusted_text)
The @warden/guard package under sdk/ts is
source-built; Warden does not claim it is published to npm. Install
the locked development dependencies, run its tests, and compile it
from the repository with Node 20.19+ (the built zero-dependency
runtime itself declares Node 18+):
cd sdk/ts
npm ci
npm test
npm run build
import { WardenClient } from "@warden/guard";
const warden = new WardenClient(); // hosted free default; failOpen: true
const result = await warden.scan(untrustedText);
This client has no local TypeScript scanner engine. Its default free
hosted path is best-effort: network, timeout, and HTTP failures
become an ALLOW result when
failOpen: true. Setting
failOpen: false makes those hosted failures throw; it
does not move detection in-process.
Five-minute acceptance check: a known attack must raise
WardenBlocked locally, a SANITIZE result must replace
the original text, and a simulated hosted failure must never reach
an action when fail_open=False or
failOpen: false.
Keep the source payload inert.
Send it to the selected Warden surface.
Handle the typed scan decision or audit report explicitly.
Use the permitted payload or review the audit findings.
Normalized marketplace catalog
UNKNOWN Service catalog not requested.
Not established
Implementation surfaces
Arrow keys move between tabs. The selected hosted examples update from the committed catalog; local MCP remains intentionally separate from the paid service.
OnchainOS / agent operator
The operator still reviews task creation, the x402 spend, the returned result, completion, and any feedback.
Catalog-backed prompt not available.
Raw x402 / curl
Payment construction and signing belong to the wallet layer. The replay process receives only the resulting payment signature.
Catalog-backed curl not available.
Python / httpx
The selected scan example handles all three verdicts and malformed sanitization. The selected audit example validates score, grade, results, and recommendations.
Catalog-backed Python not available.
TypeScript / server fetch
The selected service determines the response type: an exhaustive scan union or a validated endpoint-audit report. The payment signature stays in the server or agent runtime.
Catalog-backed TypeScript not available.
MCP / FastMCP stdio
From a trusted Warden checkout, local MCP exposes
scan_payload, audit_agent,
harden_agent, and variant_audit_agent. The
hardening tool accepts a completed audit ID and returns its
issuer-signed, transparency-logged pack. The variant audit tool
attack-tests a consenting endpoint across encoding and semantic
attack families, returns an A–F per-class resistance grade in an
issuer-signed, verifiable report, and issues a shareable badge —
re-auditable against a prior run. Neither purchases the hosted
x402 service.
Local MCP configuration not available.
No integration example copied.
These Python adapters are source-installed optional extras. Each example uses local, fail-closed enforcement before untrusted text reaches the next component.
Insert the runnable between retrieval and the prompt. BLOCK
raises WardenBlocked; SANITIZE forwards only the
returned transformed text. Caller policy still decides whether
to continue.
from warden_guard import WardenClient
from warden_guard.langchain_guard import WardenGuardRunnable
guard = WardenGuardRunnable(WardenClient(local=True, fail_open=False))
chain = retriever | guard | prompt | model
The node postprocessor drops BLOCKed nodes and replaces SANITIZEd LLM-visible content while excluding the original metadata.
from warden_guard import WardenClient
from warden_guard.llamaindex_guard import WardenNodePostprocessor
guard = WardenNodePostprocessor(WardenClient(local=True, fail_open=False))
engine = index.as_query_engine(node_postprocessors=[guard])
The middleware short-circuits BLOCK with HTTP 400. Its default extractor replays a sanitized body; a custom extractor blocks SANITIZE because it cannot safely rewrite the original body.
from fastapi import FastAPI
from warden_guard import WardenClient, WardenGuard
app = FastAPI()
app.add_middleware(
WardenGuard,
client=WardenClient(local=True, fail_open=False),
)
TextGuard and AsyncTextGuard expose
the same strict one-input boundary without a framework
dependency.
from warden_guard import TextGuard, WardenClient
guard = TextGuard(WardenClient(local=True, fail_open=False))
safe_text = guard(untrusted_text)
Use the original payload. No implemented detector fired; this is not proof of safety.
Require a string sanitized_payload and use that value
instead of the original.
Stop the action and surface the recommendation for operator review.