Trust gate for AI agents: multi-model adversarial consensus, signed and verifiable verdicts.
EthersFlow MCP Server (io.github.Ethersflow/EthersFlow)
EthersFlow is a trust gate for AI agents that provides multi-model adversarial consensus and produces signed, verifiable verdicts. It ships as an MCP server and is accompanied by SDKs and API documentation, intended to support verification for AI outputs.
🛠️ Key Features
Multi-model adversarial consensus
Signed and verifiable verdicts
MCP server availability (toolCount: 1)
🚀 Use Cases
Trust-layer verification for AI agent outputs
Reducing hallucination risk via verification workflows
Deployment in cloudflare-workers environments
⚡ Developer Benefits
Developer toolkit with MCP server
SDKs and API docs for integration
Typed stack support indicated by topics (Python, TypeScript, SDK)
⚠️ Limitations
Readme excerpt provides version/status (API 0.2.0) but not detailed configuration or protocol method list.
Gate and verify autonomous AI agent action decisions (e.g. trades, emails, claims, API calls) via EthersFlow Multi-Model Federated Adversarial Consensus before execution.
Parameters9
agent_action
string
required
The proposed action the agent intends to take.
reasoning_chain
string
optional
The agent's internal reasoning or context leading to this decision.
context
object
optional
Structured contextual evidence, metadata, or source document references.
agent_count
number
optional
Number of adversarial audit nodes (2 to 7, default 3).
persona_preset
string
optional
scope_hint
string
optional
Optional domain or task scope hint (e.g. 'clinical_safety', 'financial_compliance', 'legal_citation', 'cybersecurity_auditor').
policy_id
string
optional
Optional policy pack identifier to evaluate against.
grounding_enabled
boolean
optional
Enable hybrid fact grounding verification.
zero_retention
boolean
optional
Enforce zero data retention (ZDR).
Raw schema
{
"type": "object",
"properties": {
"agent_action": {
"type": "string",
"description": "The proposed action the agent intends to take."
},
"reasoning_chain": {
"type": "string",
"description": "The agent's internal reasoning or context leading to this decision."
},
"context": {
"type": "object",
"description": "Structured contextual evidence, metadata, or source document references."
},
"agent_count": {
"type": "number",
"description": "Number of adversarial audit nodes (2 to 7, default 3)."
},
"persona_preset": {
"type": "string",
"enum": [
"clinical_safety",
"financial_compliance",
"legal_citation",
"cybersecurity_auditor",
"general_adversarial"
]
},
"scope_hint": {
"type": "string",
"description": "Optional domain or task scope hint (e.g. 'clinical_safety', 'financial_compliance', 'legal_citation', 'cybersecurity_auditor')."
},
"policy_id": {
"type": "string",
"description": "Optional policy pack identifier to evaluate against."
},
"grounding_enabled": {
"type": "boolean",
"description": "Enable hybrid fact grounding verification."
},
"zero_retention": {
"type": "boolean",
"description": "Enforce zero data retention (ZDR)."
}
},
"required": [
"agent_action"
]
}
Velocity Capping & Preconditions: Operational tickets (e.g. FAC-101) have an automated allowance of 5 fast-path approvals per 24 hours ($500 cap). The velocity cap counts attempts (stateful), requiring a proper 5-purchase precondition on a fresh ticket for verification. 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 in docs/calibration-benchmark.md.
Launch Architecture Principle: "The deterministic fast path plus signed receipt is the provable core; consensus is escalation telemetry whose semantic detection is confirmed (3/3 on kernel-invisible attacks) but conditionally reachable — under measurement, published."
Retention Architecture & Audit Logging
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 confirms payload_retained: false and retention.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:
json
{"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 via GET /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_only mode, 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 via agent_action_sha256 and verifiable against public JWKS keys.
Canonical Policy IDs
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):
Immediate fail-closed tripping on anomalous wire transfers, credential exfiltration, prompt injection patterns, or authority bypasses.
Enforcement vs. Advisory Positioning
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 REJECTED or FLAGGED_HUMAN_REVIEW verdict with approval_blocked: true.
Gate wrappers like cloudflareVerifyGate in @ethersflow/sdk or 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) unless fail_mode: "fail-open" is explicitly opted into by the caller.
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).
What's Included
This repository contains the official client surfaces and developer tools for the EthersFlow ecosystem:
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.
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 Authorization header at connection initialization so every tool call automatically inherits valid gateway authorization.
EthersFlow 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.
Worked Example: Diagnosing and Remediating a Naive Request
Step 1: The Naive Benign Request
A developer or agent submits an unanchored micro-expense:
json
POST /api/v1/verify
{"agent_action":"Order pens and paper for the team"}
Step 2: The Diagnostic Response
Because the request lacks structured anchors, it cannot be fast-pathed and is flagged for review:
json
{"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."]}
Step 3: Reading the Diagnostic Reasons & Supplying Missing Anchors
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 in context.amount_usd: 10.00.
Ticket Anchor: Attach an operational ticket identifier ("under ticket FAC-911" or context.ticket: "FAC-911").
Counterparty: Specify an approved catalog vendor ("from Staples" or context.vendor: "Staples").
Scope / Budget Allocation: Define the procurement scope (context.scope: "routine_office_supplies" or context.budget_line: "office_supplies_q3").
Step 4: The Remediated Fast-Path Request
json
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"}}
EthersFlow implements opt-in deduplication at the verification boundary to support both high-throughput distributed agent swarms and explicit, intentional re-verifications:
1. Default Behavior: Fresh Execution (Dedup is Opt-In)
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: false and c2_replayed: false.
2. Opt-In Deduplication (idempotency_key)
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 to original_request_id and the immutable action_hash.
bash
# 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 are Non-Payload Audit Metadata (N2)
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.
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.
Status & Known Limitations
Ed25519-Signed Audit Trail: Every audit node output is signed using Ed25519-EdDSA. Signatures can be verified independently against /.well-known/jwks.json with 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 any FLAGGED_HUMAN_REVIEW verdict 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.
Key Features
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/completions or /v1/messages as a drop-in replacement for existing agent pipelines.
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]
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: