Skip to main content

Truce for AI agents

A neutral mediator your agent can call. When your agent disagrees with another agent (a refund, a late delivery, an invoice, a booking, a contract term), Truce hears both sides, proposes a fair outcome on the merits, and settles it automatically when the outcome is inside both agents' private limits. Free for AI agents. Truce never moves money; humans have the final say.

  • MCP server: https://trucehq.com/mcp (Streamable HTTP, no key). Official MCP Registry: com.trucehq/truce
  • A2A: agent card https://trucehq.com/.well-known/agent-card.json, endpoint POST https://trucehq.com/a2a
  • REST: https://trucehq.com/openapi.json
  • Open protocol: PROTOCOL.md (Agent Dispute Protocol v0.1)
  • Full guide with snippets for OpenAI, Claude, LangChain, CrewAI, Google ADK and Vercel AI SDK: AGENTS_GUIDE.md

Python

pip install trucehq
from trucehq import Truce
t = Truce()
a = t.open_dispute(topic="Late delivery refund", name="Buyer agent", acting_for="Sam Lee", authorized_by="Sam Lee",
                   statement="Lamp ordered for $80 arrived 12 days late, scratched.",
                   wants="A $40 refund", mandate={"role": "payee", "limit_usd": 20, "auto_accept": True})
# send a["invite_code"] to the other agent; it calls:
b = t.respond(invite_code=a["invite_code"], name="Seller agent", acting_for="Lamp Shop Ltd", authorized_by="Lamp Shop support lead",
              statement="Courier delay; the scratch is minor.", wants="$15 credit",
              mandate={"role": "payer", "limit_usd": 35, "auto_accept": True})
print(b["status"], b["proposal"]["settlement_usd"])  # e.g. agreed 25

JavaScript / TypeScript

npm install trucehq
import { Truce } from "trucehq";
const t = new Truce();
const a = await t.openDispute({ topic: "Late delivery refund", name: "Buyer agent", actingFor: "Sam Lee", authorizedBy: "Sam Lee",
  statement: "Lamp arrived 12 days late, scratched.", wants: "A $40 refund",
  mandate: { role: "payee", limit_usd: 20, auto_accept: true } });

Rules

Act only for a person or organisation that asked you to (authorized: true is sent for you; only use the client when that is true). Never sign, pay or answer for the other side. Keep keys secret. Not for abuse, violence, threats, a child's safety or crimes.

Truce is a member of ICODR, the International Council for Online Dispute Resolution; Truce publishes an open self-assessment against the NCTDR-ICODR ODR Standards: https://trucehq.com/standards

MIT licensed. Questions: frank@trucehq.com · https://trucehq.com/agents

0.2.0

  • authorized_by / authorizedBy is now required: name who asked you to act. No hardcoded consent.
  • Optional free agent key (Truce.register(...)) for higher limits and a registered badge.
  • get() sends the dispute key in the X-Truce-Key header, never in the URL.

LangChain, CrewAI and the OpenAI Agents SDK (0.3.0)

Four ready tools (open, respond, status, decide), bound to the person who authorised your agent:

from trucehq import Truce
from trucehq.integrations import langchain_tools, crewai_tools, openai_agents_tools, tool_specs, call

tools = langchain_tools(Truce(), authorized_by="Sam Lee, account owner")       # pip install langchain-core
tools = crewai_tools(Truce(), authorized_by="Ops lead")                         # pip install crewai
tools = openai_agents_tools(Truce(), authorized_by="Sam Lee")                   # pip install openai-agents
specs = tool_specs()  # plain JSON-schema functions for any other framework; run them with call(name, args, Truce(), authorized_by=...)

Private limits (max_refund_usd, min_accept_usd) go to Truce only and are never shown to the other agent.

Metadata

Release files for trucehq 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trucehq 0.3.0
File Size Uploaded Provenance Actions
trucehq-0.3.0.tar.gz 6.1 kB With provenance Details for trucehq-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for trucehq 0.3.0
File Interpreter ABI Platform Actions
trucehq-0.3.0-py3-none-any.whl Python 3 none any Details for trucehq-0.3.0-py3-none-any.whl

Total release size: 13.5 kB

Release files / trucehq-0.3.0.tar.gz

Download URL trucehq-0.3.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7408401cd20f48a9bc867ee5b43f92f79ce93c5d46f56ba0687ba6f49af354da
BLAKE2b-256 checksum
How to use checksums
baefa5c6f614077008f5219a8dd2bb14e16ae290b0e0711c528692612f22bf9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / trucehq-0.3.0-py3-none-any.whl

Download URL trucehq-0.3.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36c14603fe40de6c29e9cf6dd9e5272851eed05775b17dadfb7310b4a2e1a222
BLAKE2b-256 checksum
How to use checksums
05df88ad2355f35fb863f88fefba7cb9f416caacf9637847ca17380642554625
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for trucehq 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for trucehq-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page