Skip to main content

Machine-readable service contracts and quality verification for autonomous agent commerce — the agreements layer of the Agent Trust Stack

Project description

Agent Service Agreements

PyPI Python License

Machine-readable service contracts and quality verification for autonomous agent commerce. Part of the Agent Trust Stack.

from agent_service_agreements import Identity, create_agreement_from_template, VerificationEngine

agreement = create_agreement_from_template("research",
    client=Identity(scheme="api_key", value="client-123"),
    provider=Identity(scheme="api_key", value="provider-456"),
    escrow_amount="5.00")

result = VerificationEngine().verify(deliverable_text, original_request="Summarize federated learning research")
print(f"Score: {result.composite_score}, Passed: {result.passed}")

What It Does

ASA provides two API surfaces for agent-to-agent commerce:

Agreements API — Create, negotiate, sign, and manage machine-readable service contracts with quality criteria, SLO definitions, and payment terms.

Verification API — Evaluate deliverable quality across multiple dimensions (correctness, completeness, coherence, etc.) with structural and semantic verification. Works standalone or against agreement criteria.

Install

pip install agent-service-agreements

Zero required dependencies. Python 3.8+.

Optional integrations:

pip install agent-service-agreements[arp]  # Agent Rating Protocol
pip install agent-service-agreements[ajp]  # Agent Justice Protocol

CLI

# Create an agreement from a template
agent-service agree --template research --client alice --provider bob --amount 5.00

# Verify a deliverable
agent-service verify --deliverable output.md --request "Summarize FL research" --type text/research

# List templates
agent-service templates

# Check store status
agent-service status

Agreement Templates

Template Dimensions Threshold
research accuracy, completeness, relevance, source_quality, writing_quality 75
code_generation correctness, performance, security, maintainability, test_coverage 80
data_analysis accuracy, methodology, depth, clarity, actionability 75
translation accuracy, fluency, cultural_fit, terminology, completeness 80
review thoroughness, accuracy, actionability, tone, completeness 75
general accuracy, completeness, relevance, clarity, timeliness 70

Escrow & Graduated Payment

ASA supports graduated payment release based on quality scores:

Score Release
>= 90 100%
75-89 85%
60-74 50%
< 60 0% (dispute option)

Continuous mode available: payment = (score / 100) * amount.

Dead-man's switch defaults to hold_for_backup_evaluator (not release_to_provider).

Negotiation

Multi-round structured negotiation with fairness constraints:

  • Configurable round limits (default: 5)
  • Asymmetry limits (max 25% change per round)
  • Price bounds relative to market rates
  • Structured JSON messages (no free-text manipulation)

Verification Depths

  • Structural: Schema validation, format checks, size constraints (~0ms)
  • Semantic: Agent-as-a-Judge integration point for content quality (~10-120s)
  • Composite: Structural + semantic + optional canary/cross-reference checks

Trust Ecosystem

ASA is Layer 2 in the Agent Trust Stack:

Layer 3: Accountability  — Agent Justice Protocol (disputes, forensics)
Layer 2: Agreements      — Agent Service Agreements (this package)
Layer 1: Trust Primitives — Chain of Consciousness + Agent Rating Protocol

Security

VAM-SEC v1.0 Security Disclaimer: This is alpha software implementing a protocol specification. It has not undergone formal security audit. Do not use for production financial transactions without additional security review. The escrow abstraction layer does not handle actual funds — it computes release amounts that must be executed by an external payment system.

License

Apache 2.0. See LICENSE.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_service_agreements-0.1.1.tar.gz (43.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_service_agreements-0.1.1-py3-none-any.whl (38.2 kB view details)

Uploaded Python 3

File details

Details for the file agent_service_agreements-0.1.1.tar.gz.

File metadata

  • Download URL: agent_service_agreements-0.1.1.tar.gz
  • Upload date:
  • Size: 43.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for agent_service_agreements-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a33ee6773f844e6c8039def3f07ccff716805fa995f9f26e0ea35241a063de14
MD5 8812c570077d0448ec22a1e989a278c2
BLAKE2b-256 a31a9706e441b43373e3a8fbcee07b5a934ee7d81336d5e57286c089abc41a21

See more details on using hashes here.

File details

Details for the file agent_service_agreements-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_service_agreements-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b255711bc5c1ee2d6cf69aab2042c5e31052cc7ae50a4f194caad2e051bca66a
MD5 4a4e46891c9f9778a1c6ac03156f644c
BLAKE2b-256 e3d547cd4843f6d6cdd8dc475d2a94e557aec2cb66f9eda91d6b87a2c0bae3e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page