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.

Metadata

Release files for trucehq 0.2.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.2.0
File Size Uploaded Provenance Actions
trucehq-0.2.0.tar.gz 4.3 kB With provenance Details for trucehq-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 9.4 kB

Release files / trucehq-0.2.0.tar.gz

Download URL trucehq-0.2.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4447c4982c274cf2a23eb9485366cec8eedaab6e92aa9a3e7c3ec0f12110dd08
BLAKE2b-256 checksum
How to use checksums
a3a2e1f1bfbce3a2b9b8b205e1d7f3347a7abc68a603ae4a94110d4d0da29eb2
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.2.0-py3-none-any.whl

Download URL trucehq-0.2.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf23a30784738616214c573d2f231044215402a272b994df8cc27d73e0964628
BLAKE2b-256 checksum
How to use checksums
df82825eedf8ea754eee14504633050356ae997bb9dee793a2033f98a1f134ee
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.2.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.2.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