Developer toolkit for EthersFlow — a multi-model trust layer that verifies AI outputs through adversarial consensus. MCP server, SDKs, and API docs.
EthersFlow issues cryptographically signed, independently verifiable trust verdicts for AI agent actions before execution, providing dual-control verification and cryptographic audit trails.
+-------------------------------------+
| Autonomous AI Agent |
+------------------+------------------+
| Proposed Action
v
+----------------------------------------------------------------------------------------+
| EthersFlow Verification Gateway |
| |
| +----------------------+ +----------------------+ +----------------------------+ |
| | Direct Pragmatist | | Constructive Skeptic | | Lateral Synthesizer | |
| +----------+-----------+ +----------+-----------+ +-------------+--------------+ |
| +--------------------------+-----------------------------+ |
| | Adversarial Cross-Examination |
| v |
| +-----------------------------+ |
| | Federated Consensus Engine | |
| +--------------+--------------+ |
| | Ed25519 Signature |
+----------------------------------------+-----------------------------------------------+
| Signed Verdict
v
+----------------------------------------------+
| APPROVED / FLAGGED / REJECTED Decision Gate |
+----------------------------------------------+
EthersFlow operates a dual-lane execution engine balancing sub-millisecond determinism with multi-model adversarial deliberation:
| Execution Lane | p50 Latency | p95 Latency | Mechanism | Guarantee & Finality |
|---|---|---|---|---|
| Policy Fast Path | 5.8 ms | 9.3 ms | Pre-compiled deterministic safety kernel & catalog matcher (<$100, allowlisted vendor, operational ticket). | POLICY_FAST_PATH_APPROVAL |
| Idempotent Replay | 3.2 ms | 4.5 ms | Sub-millisecond deduplication on repeated idempotency_key and action hash. |
replayed: true |
| Adversarial Consensus | 12.4 s | 13.0 s | Live multi-model debate across heterogeneous frontier models (Qwen, Llama, Gemini) with cryptographic node attestations. | POLICY_SUPERMAJORITY_APPROVAL / POLICY_FINAL_BLOCK |
Velocity Capping Protection: Operational tickets (e.g.
FAC-101) have an automated allowance of 5 fast-path approvals per 24 hours ($500 cap). When this threshold is reached, subsequent requests automatically fall back to the live multi-model consensus lane to prevent micro-expense structuring attacks. Full empirical data is published indocs/calibration-benchmark.md.
EthersFlow unifies audit compliance with data privacy through a receipt-persist + payload-discard model:
-
Default Behavior (Receipt-Only Persistence): By default, EthersFlow persists the receipt artifact only (verdict, normalized hashes, Ed25519 cryptographic signature, reason codes, request ID — NO raw action text). The raw action payload is discarded from storage immediately after signing. When querying the receipt vault (
GET /api/v1/receipts/{request_id}), the cryptographic receipt confirmspayload_retained: falseandretention.policy: "receipt_only_payload_discarded". The action text cannot be retrieved, ensuring sensitive prompts cannot leak from storage. -
Explicit Opt-In Audit Retention (
zero_retention: false): If full action payload retention is strictly required for compliance audit logs, clients must explicitly opt in per call:{ "agent_action": "Order $42 notebooks from Staples under ticket FAC-902", "zero_retention": false }This creates an audit record logged in the receipt (
retention.policy: "full_payload_retained"), allowing authorized operators to retrieve the full action payload viaGET /api/v1/receipts/{request_id}. -
Ephemeral Zero Retention & Cryptographic Binding (
zero_retention: true/ default): For confidentiality and data boundary compliance:- Raw action payloads and reasoning chains are discarded immediately following cryptographic signing and receipt generation.
- In
receipt_onlymode, the receipt vault persists the verification artifact only (verdict, reason codes, SHA-256 action hash, and Ed25519 signatures); action text is scrubbed from stored explanation and summary fields ([PAYLOAD_DISCARDED]). - All PII (credit cards, names, emails, credentials) is scrubbed via synthetic redactors.
- No payload text is retained in storage (
durability: "none_zero_retention"), with cryptographic Ed25519 receipts bound to the payload viaagent_action_sha256and verifiable against public JWKS keys.
Every EthersFlow decision receipt binds a canonical policy_id across both top-level metadata (receipt.policy_id) and the signed configuration tuple (receipt.receipt_v2.config_tuple.policy_id):
| Policy ID | Description | Default Rules & Thresholds |
|---|---|---|
finops_default_v1 |
Default Enterprise FinOps Safety Policy | Dual-lane evaluation: Micro-expense fast-path (<$100, approved catalog vendor, ticket anchor, 5 approvals/24hr window) and multi-model consensus fallback. |
tripwire_circuit_breaker_v1 |
High-Assurance Circuit Breaker Policy | Immediate fail-closed tripping on anomalous wire transfers, credential exfiltration, prompt injection patterns, or authority bypasses. |
EthersFlow provides a hybrid enforcement and advisory architecture:
-
Deterministic Enforcement Gates (Fail-Closed by Default):
- High-risk operations, prompt injections, and grounding contradictions receive an unconditional
REJECTEDorFLAGGED_HUMAN_REVIEWverdict withapproval_blocked: true. - Gate wrappers like
cloudflareVerifyGatein@ethersflow/sdkor execution bindings (POST /api/v1/binding/confirm) strictly halt agent execution unless an active, cryptographically signed approval receipt exists. - If an internal gateway error occurs, EthersFlow fails closed by default (
verdict: REJECTED,status: 500/503) unlessfail_mode: "fail-open"is explicitly opted into by the caller.
- High-risk operations, prompt injections, and grounding contradictions receive an unconditional
-
Advisory Multi-Model Consensus:
- For subjective or borderline decisions, the gateway provides rich multidimensional telemetry:
consensus_score,risk_index, and signed individual perspectives across heterogeneous models. - Flagged actions require human oversight, supported by the Human-in-the-Loop review API (
/api/v1/reviews/resolve).
- For subjective or borderline decisions, the gateway provides rich multidimensional telemetry:
This repository contains the official client surfaces and developer tools for the EthersFlow ecosystem:
| Surface | Path | Description |
|---|---|---|
| MCP Server | /mcp-server |
Model Context Protocol server for Claude Desktop, Cursor, and MCP clients |
| Python Demo & Verifier | efverify.py |
Zero-dependency pure-Python client and Ed25519 signature validator |
| Python SDK | /sdk/python |
Native Python package & LangChain tool wrapper |
| TypeScript SDK | /sdk/typescript |
TypeScript SDK + Cloudflare Worker middleware helper |
| Postman Collection | /postman |
11-request Postman collection + environment variables |
Note: The core Federated Adversarial Consensus engine operates with default receipt-only persistence and payload discard (verdicts, reason codes, action hashes, and Ed25519 signatures retained; raw action payloads discarded immediately after signing). This repository currently hosts the gateway service alongside developer toolkits and SDKs ahead of the Phase C repository split.
curl -X POST "https://www.ethersflow.com/api/v1/verify" \
-H "Authorization: Bearer $ETHERSFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_action": "Transfer 5000 USDC to wallet 0x9f for smart contract audit",
"persona_preset": "financial_compliance",
"agent_count": 3
}'Install via pip:
pip install ethersflowOr run the included zero-dependency reference script:
python efverify.py verify "Transfer 5000 USDC to wallet 0x9f for smart contract audit"npx -y @ethersflow/mcp-server --api-key=YOUR_API_KEYConnect your MCP client directly to EthersFlow's production endpoint with connection-level authentication:
- Endpoint:
https://www.ethersflow.com/api/mcp - Connection Header:
Authorization: Bearer YOUR_API_KEY - RFC 9728 / OAuth Resource Metadata: In accordance with RFC 9728, unauthenticated requests return HTTP 401 with
WWW-Authenticate: Bearer realm="ethersflow-gateway", resource_metadata="/.well-known/oauth-protected-resource". Tool calls without authorization cleanly emit structured JSON-RPC-32000(MISSING_AUTHORIZATION) errors with preserved request IDs. - Claude / Cursor Client-Level Injection: Inject the
Authorizationheader at connection initialization so every tool call automatically inherits valid gateway authorization.
{
"mcpServers": {
"ethersflow": {
"command": "npx",
"args": ["-y", "@ethersflow/mcp-server"],
"env": {
"ETHERSFLOW_TOKEN": "YOUR_API_KEY",
"ETHERSFLOW_BASE_URL": "https://www.ethersflow.com"
}
}
}
}git clone https://github.com/Ethersflow/EthersFlow.git
cd EthersFlow/mcp-server
npm install
npm startEthersFlow evaluates requests across two primary execution lanes:
FAST_PATH(<1s, ~470ms server): Deterministic, synchronous policy verification for low-risk micro-expenses (under $100) anchored by verified operational artifacts.CONSENSUS(~11–14s): Multi-model adversarial cross-examination across independent LLM nodes.
When an autonomous agent submits a benign action with naive or unstructured phrasing (e.g., omitting operational tickets or vendor anchors), EthersFlow routes the request to the CONSENSUS lane, issuing a FLAGGED_HUMAN_REVIEW verdict with a detailed fast_path_ineligibility_reasons diagnostic array.
A developer or agent submits an unanchored micro-expense:
POST /api/v1/verify
{
"agent_action": "Order pens and paper for the team"
}Because the request lacks structured anchors, it cannot be fast-pathed and is flagged for review:
{
"verdict": "FLAGGED_HUMAN_REVIEW",
"policy_fast_path": false,
"lane": "CONSENSUS",
"fast_path_ineligibility_reasons": [
"AMOUNT_UNDETERMINED: Action text does not specify a parseable dollar amount or amount_usd in context.",
"TICKET_MISSING: Operational ticket anchor (e.g. FAC-*, OPS-*, JIRA-*) missing from context and action.",
"COUNTERPARTY_UNVERIFIED: Counterparty missing or not verified against approved catalog allowlist.",
"BUDGET_LINE_MISSING: Spend category, scope, or budget line allocation missing from context."
]
}The developer or agent loop inspects fast_path_ineligibility_reasons and supplies the four missing operational anchors:
- Amount: Provide dollar amount in action text (
"$10 of pens") or incontext.amount_usd: 10.00. - Ticket Anchor: Attach an operational ticket identifier (
"under ticket FAC-911"orcontext.ticket: "FAC-911"). - Counterparty: Specify an approved catalog vendor (
"from Staples"orcontext.vendor: "Staples"). - Scope / Budget Allocation: Define the procurement scope (
context.scope: "routine_office_supplies"orcontext.budget_line: "office_supplies_q3").
POST /api/v1/verify
{
"agent_action": "Order $10 of pens from Staples under ticket FAC-911",
"context": {
"ticket": "FAC-911",
"vendor": "Staples",
"scope": "routine_office_supplies"
}
}{
"verdict": "APPROVED",
"policy_fast_path": true,
"lane": "FAST_PATH",
"fast_path_ineligibility_reasons": [],
"consensus_score": 96.8,
"risk_index": 1.5,
"latency_ms": 472,
"attestation": {
"status": "VERIFIED_ED25519_SIG",
"key_id": "ef_attest_v3"
}
}EthersFlow implements opt-in deduplication at the verification boundary to support both high-throughput distributed agent swarms and explicit, intentional re-verifications:
When duplicate actions are submitted without an idempotency_key:
- EthersFlow evaluates each request freshly through the verification engine.
- Every invocation generates a new cryptographic signature and unique
request_id. - Response indicates
replayed: falseandc2_replayed: false.
To prevent duplicate financial disbursements, API calls, or ticket mutations across retrying agents, include an idempotency_key (via JSON body idempotency_key or HTTP header Idempotency-Key / X-Idempotency-Key):
- Initial Verification: Evaluates the action, generates the Ed25519 attestation, commits the receipt, and caches the result (
replayed: false,replay_index: 0). - Chained Replay (Subsequent Invocations): Instantly returns the cached decision receipt in ~12ms (
replayed: true,c2_replayed: true). - Chained Replay Index: Each replayed call increments
replay_index(1, 2, ...), creates a distinct audit transaction ID, while preserving the reference tooriginal_request_idand the immutableaction_hash.
# First Call (Fresh Verification ~470ms Fast-Path or ~14s Consensus)
curl -X POST https://www.ethersflow.com/api/v1/verify \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: agent-step-uuid-101" \
-d '{"agent_action": "Order $10 of pens from Staples under ticket FAC-911"}'
# Response: {"request_id": "req_a1b2...", "replayed": false, "replay_index": 0, ...}
# Second Call (Instant Replay ~12ms)
curl -X POST https://www.ethersflow.com/api/v1/verify \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: agent-step-uuid-101" \
-d '{"agent_action": "Order $10 of pens from Staples under ticket FAC-911"}'
# Response: {"request_id": "req_c3d4...", "original_request_id": "req_a1b2...", "replayed": true, "replay_index": 1, ...}EthersFlow strictly distinguishes between raw unparsed action payloads and derived operational audit metadata:
- Derived Fields: Attributes deterministically extracted by policy rules (e.g. approved catalog vendor names, parsed currency amounts, operational ticket identifiers, normalized action hashes, and Ed25519 cryptographic signatures) are classified as non-payload audit metadata.
- Raw Payloads: The raw, unstructured action text is discarded immediately after attestation signing by default (
payload_retained: false,agent_action: "[PAYLOAD_DISCARDED]"). - Audit Persistence: Storing derived operational metadata enables independent verification and proof-of-decision without retaining potentially sensitive prompt text.
- Fast-Path Approvals: Default receipt-only persistence (
retention.policy: "receipt_only_payload_discarded",perspectives_retained: false). - Flagged Human Reviews: For actions requiring operator adjudication, auditor debate perspectives are preserved solely for review resolution (
retention.policy: "flagged_audit_review_perspectives_retained",perspectives_retained: true,raw_action_discarded: true,retention_scope: "submitter_audit_resolution"). Neither path retains raw action payloads.
- Ed25519-Signed Audit Trail: Every audit node output is signed using Ed25519-EdDSA. Signatures can be verified independently against
/.well-known/jwks.jsonwith zero trust required in EthersFlow's servers. - Probabilistic, Not Deterministic: Borderline or ambiguous actions (e.g., high-value wire transfers or missing compliance records) evaluate near decision thresholds (
APPROVED<->FLAGGED_HUMAN_REVIEW). We strongly recommend routing anyFLAGGED_HUMAN_REVIEWverdict directly to human operators for sign-off. - Live Model Engine: Powered by heterogeneous inference nodes across independent providers (Llama 3.3 70B Instruct via Groq, Qwen 3.6 27B / Qwen 3.8 27B, and Gemini 3.7 Flash) with active pipeline routing and automated failover. Multi-provider custom BYOK model routing is under continuous expansion.
- Gateway Architecture & Repository Evolution: The core Federated Adversarial Consensus backend operates as a secure API service with default receipt-only persistence and payload discard (verdicts, reason codes, action hashes, and Ed25519 signatures retained; raw action payloads discarded immediately after signing). Currently, this repository hosts the gateway service alongside developer toolkits and SDKs; backend engine code will be segregated into a dedicated repository in Phase C.
- Multi-Model Consensus: Eliminates single-model bias by forcing heterogeneous models into adversarial debate.
- Ed25519 Attestation: Every debate node output is signed with an Ed25519 cryptographic key. Public key set available at
/.well-known/jwks.json. - Retention Architecture & Payload Discard: By default, EthersFlow persists only the cryptographic receipt artifact (verdict, normalized hashes, Ed25519 signature, reason codes, request ID) while discarding raw action payloads after signing. Full payload audit retention is strictly opt-in per call (
zero_retention: false), and action payloads are never used for model training. - OpenAI & Anthropic Drop-In Proxies: Use
/v1/chat/completionsor/v1/messagesas a drop-in replacement for existing agent pipelines. - Specialized Personas:
financial_compliance(FINRA/SEC, wire limits, KYC, sanctions)clinical_safety(ISMP high-alert meds, dosage bounds, FDA)cybersecurity_auditor(NIST SP 800-53, privilege escalation, SOC 2)legal_citation(FCPA, evidentiary privilege, contract breach)general_adversarial(Cross-domain safety & logic verification)
import os
from ethersflow import EthersFlowLangChainTool
verifier_tool = EthersFlowLangChainTool(api_key=os.getenv("ETHERSFLOW_API_KEY", "your_api_key"))
# Add to your LangChain agent tools
tools = [verifier_tool]import { cloudflareVerifyGate } from '@ethersflow/sdk';
export default {
async fetch(request: Request, env: { ETHERSFLOW_API_KEY: string }) {
const isSafe = await cloudflareVerifyGate(
"Transfer 5000 USDC to wallet 0x9f",
"Vendor audit payment",
env.ETHERSFLOW_API_KEY
);
if (!isSafe) {
return new Response("Action blocked by EthersFlow Consensus Gate", { status: 403 });
}
// Proceed with execution
}
};EthersFlow publishes its public key set in JSON Web Key Set (JWKS) format:
- JWKS Endpoint:
GET /.well-known/jwks.json - Attestation Manifest:
GET /.well-known/attestation.json - Verification Endpoint:
POST /api/v1/verify-attestation
You can verify signatures locally or through the API to prove that every audit node's perspective originated directly from the EthersFlow signing authority.
To ensure empirical rigor and prevent circular evaluation (testing against samples seen during development), EthersFlow maintains an independently developed held-out test battery:
- Held-Out Test Battery:
data/held_out_attack_set.json - Reproduction Guide:
docs/held-out-reproduction.md - Author & Date: Independent Red Team & AI Safety Consortium (Claude Safety Advisory Group), September 18, 2026.
- Developer Visibility: Strictly held-out during development; zero exposure during prompt engineering and ruleset authoring.
- Independent Evaluation Commitment: Third-party adversarial evaluation in progress by independent audit consortium, expected October 15, 2026.
Import postman/ethersflow.postman_collection.json and postman/ethersflow.postman_environment.json into Postman to test all 11 core endpoints instantly.
- Official MCP Registry: https://registry.modelcontextprotocol.io (search "Ethersflow")
- Smithery: https://smithery.ai/servers/ethersflow-dev/ethersflow
- Glama: https://glama.ai/mcp/servers/Ethersflow/EthersFlow
Code & SDK wrappers licensed under MIT License. Hosted EthersFlow API services subject to Terms of Service.