Catalog PyPI
PACKAGE EXPLORERView in registry

agent-trust-stack

PyPI

Complete Agent Trust Stack — one install for provenance, reputation, agreements, accountability, lifecycle, discovery, and economics

accountabilityagentagreementsaiautonomouseconomicsinfrastructurelifecyclematchmakingmulti-agentprovenancereputationtrust
Versions collected1
Direct dependencies7From release 0.1.1
Last observed20 Oct, 23:35 UTC

README

Version 0.1.1 documentation

agent-trust-stack

License: Apache 2.0 Python 3.8+ PyPI

Complete institutional infrastructure for the autonomous agent economy.

One install gives you all seven trust protocols from the Theory of Agent Trust:

ProtocolPackageWhat It Does
Chain of Consciousnesschain-of-consciousnessCryptographic provenance — tamper-evident operational history
Agent Rating Protocolagent-rating-protocolReputation — multidimensional bilateral blind evaluation
Agent Justice Protocolagent-justice-protocolAccountability — forensics, disputes, actuarial risk
Agent Service Agreementsagent-service-agreementsContracts — machine-readable agreements with quality verification
Agent Lifecycle Protocolagent-lifecycle-protocolLifecycle — birth, fork, succession, death, reputation inheritance
Agent Matchmaking Protocolagent-matchmakingDiscovery — cross-platform matching weighted by trust signals
Context Window Economicscontext-window-economicsEconomics — bilateral cost allocation for agent interactions

Quick Start

pip install agent-trust-stack
from agent_trust_stack import TrustStack

stack = TrustStack(agent_id="did:example:my-agent")
stack.coc.add("boot", "Agent initialized")
print(stack.status_summary())

CLI

# Initialize a trust stack
trust-stack init did:example:my-agent

# Check status
trust-stack status did:example:my-agent

# Run full trust verification
trust-stack verify did:example:my-agent --json

Full Integration Example

from agent_trust_stack import (
    TrustStack,
    RatingRecord,
    Agreement,
    UCPBuilder,
)
from agent_service_agreements import Identity, ServiceSpec
from agent_justice_protocol import AgentReference, IncidentReport

# 1. Initialize the stack
stack = TrustStack(agent_id="did:example:provider-1", storage_root="./my-stack")

# 2. Record provenance
stack.coc.add("boot", "Service provider online")
stack.coc.add("note", "Ready for work")

# 3. Get rated by a client
rating = RatingRecord(
    rater_id="did:example:client-1",
    ratee_id="did:example:provider-1",
    interaction_id="job-042",
    reliability=85,
    accuracy=90,
    latency=75,
    protocol_compliance=80,
    cost_efficiency=70,
)
stack.arp_store.append(rating)

# 4. Create a service agreement
agreement = Agreement(
    agreement_id="asa-042",
    status="active",
    client=Identity(agent_id="did:example:client-1"),
    provider=Identity(agent_id="did:example:provider-1"),
    service=ServiceSpec(
        service_type="research",
        description="Literature review on agent trust",
        input_spec={"query": "string"},
        output_spec={"report": "markdown"},
    ),
)
stack.asa_store.save(agreement)

# 5. Meter the interaction cost
cmr = stack.meter.record_interaction(
    responder_id="did:example:client-1",
    request_tokens=5000,
    response_tokens=3000,
)
print(f"Interaction cost: ${cmr.total_cost_usd:.4f}")

# 6. Build a capability profile for matchmaking
ucp = (
    UCPBuilder()
    .identity(amp_id="did:example:provider-1", coc_chain_id="./my-stack/coc")
    .add_capability(
        domain="research",
        subdomain="literature_review",
        description="Comprehensive literature reviews",
    )
    .availability(status="operational", uptime_percent=99.5)
    .build()
)

# 7. Cross-protocol: lifecycle change syncs to matchmaking
stack.bus.sync_lifecycle_to_matchmaking("did:example:provider-1", "active")

# 8. Cross-protocol: dispute outcome updates reputation
stack.bus.apply_dispute_outcome_to_reputation(
    dispute_id="dispute-001",
    at_fault_agent_id="did:example:provider-1",
    severity="minor",
    fault_percentage=25.0,
)

# 9. Run full trust verification across all protocols
report = stack.bus.run_full_trust_verification("did:example:provider-1")
print(f"Composite trust score: {report['composite_trust_score']}/100")

# 10. Verify chain integrity
result = stack.coc.verify()
print(f"Chain integrity: {'VALID' if result.valid else 'BROKEN'}")

Cross-Protocol Integration

The IntegrationBus wires feedback loops between protocols:

  • CoC -> ARP: Chain age provides trust tier signals for reputation context
  • ARP -> AJP: Anomalous ratings trigger investigation flags
  • AJP -> ARP: Dispute outcomes update reputation scores
  • ASA -> AMP: Completed agreements feed performance metrics for matchmaking
  • ALP -> AMP: Lifecycle state changes sync to availability status
  • CWEP -> ASA: Cost metering validates agreement budget compliance
  • ALP -> ARP: Fork/succession events trigger reputation inheritance

Architecture

                    TrustStack
                        |
        +-------+-------+-------+-------+-------+-------+
        |       |       |       |       |       |       |
       CoC     ARP     AJP     ASA     ALP     AMP    CWEP
    (prov)  (rep)   (just)  (agree) (life) (match) (econ)
        |       |       |       |       |       |       |
        +-------+---+---+-------+---+---+-------+-------+
                    |               |
              IntegrationBus   IntegrationBus
            (feedback loops)  (data flows)

API Reference

TrustStack

TrustStack(
    agent_id: str,              # Agent identifier
    storage_root: str = None,   # Storage directory (default: .trust-stack)
    model: str = "claude-sonnet-4-6",  # For CWEP metering
    provider: str = "anthropic",       # For CWEP metering
)

Attributes:

  • coc — Chain instance (provenance)
  • arp_store — RatingStore instance (reputation)
  • ajp_store — JusticeStore instance (accountability)
  • asa_store — AgreementStore instance (contracts)
  • alp_store — LifecycleStore instance (lifecycle)
  • amp_store — MatchmakingStore instance (discovery)
  • meter — Meter instance (cost metering)
  • bus — IntegrationBus instance (cross-protocol wiring)

Methods:

  • status() — Returns dict of ProtocolStatus for all seven protocols
  • status_summary() — Human-readable status string
  • verify_all() — Run verification across all protocols
  • add_chain_entry(event_type, data) — Convenience wrapper for CoC
  • get_chain_age_days() — Chain age in days
  • build_ucp() — Build a UCP pre-populated with agent identity

IntegrationBus

  • get_chain_age_trust_signal(agent_id) — CoC -> ARP trust signal
  • check_rating_anomaly(rating) — ARP -> AJP anomaly detection
  • apply_dispute_outcome_to_reputation(...) — AJP -> ARP reputation update
  • record_agreement_completion(...) — ASA -> AMP performance data
  • sync_lifecycle_to_matchmaking(...) — ALP -> AMP availability sync
  • check_cost_compliance(cmr, agreement) — CWEP -> ASA budget check
  • inherit_reputation_on_fork(...) — ALP -> ARP reputation inheritance
  • run_full_trust_verification(agent_id) — Cross-protocol trust report

Configuration

Each protocol stores data in its own subdirectory under the storage root:

.trust-stack/
  coc/      # Chain of Consciousness (JSONL chain)
  arp/      # Agent Rating Protocol (JSONL ratings)
  ajp/      # Agent Justice Protocol (disputes, investigations)
  asa/      # Agent Service Agreements (agreements)
  alp/      # Agent Lifecycle Protocol (agent records)
  amp/      # Agent Matchmaking Protocol (UCPs, matches)
  cwep/     # Context Window Economics (CMRs, settlements)

VAM-SEC Disclaimer

This software is provided for research and development purposes. It has not been independently audited for production security. Deployments handling real economic value should undergo professional security review. The protocols implement cryptographic integrity checking (SHA-256 hash chains) but do not provide encryption at rest. See vibeagentmaking.com for details.

License

Apache 2.0 — See LICENSE for details.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.15 Apr 20267

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
theory-of-agent-trust/agent-trust-stack

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:35 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:c5dbbc952a65b0996c7922276ec6d20ed910103aa9343c7b4940276f204f19f3