Skip to main content

Mycelium Trails community plugin for the AGT EvidenceAnchor SPI

Project description

mycelium-agt

Community plugin for the Agent Governance Toolkit (AGT) EvidenceAnchor SPI, backed by Mycelium Trails on Arbitrum.

Evidence hashes are written as immutable trail records via the public argentum.rgiskard.xyz API. Once anchored, records cannot be modified or deleted.

Install

pip install mycelium-agt

Usage

from mycelium_agt import MyceliumAnchor

anchor = MyceliumAnchor(agent_id="my-agent")

# Anchor an evidence hash
receipt = anchor.anchor(
    evidence_hash="sha256:abc123...",
    metadata={"action_type": "file:write", "scope": "audit"},
)
print(receipt.anchor_id)      # trail_id in Mycelium Trails
print(receipt.anchored_at)    # RFC 3339 UTC timestamp

# Verify later
result = anchor.verify("sha256:abc123...", receipt)
print(result.status)          # AnchorVerifyStatus.VERIFIED
print(result.inclusion_proof.proof_data["tx_hash"])

How it works

MyceliumAnchor implements the AGT EvidenceAnchor abstract class:

  • anchor(evidence_hash, metadata) — POSTs a trail record to https://argentum.rgiskard.xyz/trails. Returns an AnchorReceipt with a trail_id and deterministic action_ref (RFC 8785 JCS + SHA-256).

  • verify(evidence_hash, receipt) — Confirms the hash via GET /trails/verify?action_ref=... (or falls back to GET /trails/{trail_id}). Returns an AnchorVerifyResult with status VERIFIED | NOT_FOUND | HASH_MISMATCH | BACKEND_UNAVAILABLE and an Arbiscan inclusion proof.

Registration with AGT

from mycelium_agt import MyceliumAnchor

# Register with the AGT evidence registry
agt_registry.register("mycelium", MyceliumAnchor(agent_id="my-agent"))

Metadata keys

All optional:

Key Default Description
agent_id instance agent_id Override per-call
action_type "agt:evidence_anchor" Semantic label for the action
scope "agt-evidence" Trail scope
parent_trail_id Link to parent trail
root_trail_id Link to root of a trail chain

action_ref

Each anchored record gets a deterministic action_ref:

SHA-256(JCS({"agent_id": ..., "action_type": ..., "scope": ..., "timestamp": ...}))

This allows re-derivation and cross-system verification without trusting the receipt alone.

Failure semantics

anchor() raises RuntimeError on network failure. The AGT runtime applies mode semantics (enforce / queue / best_effort). verify() never raises — it returns BACKEND_UNAVAILABLE on network errors.

License

Apache 2.0

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

mycelium_agt-0.1.1.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

mycelium_agt-0.1.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mycelium_agt-0.1.1.tar.gz
Algorithm Hash digest
SHA256 079f0f22d77ff3b6f0b7ffcf1ceec149d6f5201b8b4fa247349f77097299a37d
MD5 777a2730a7dfa031bf1d7f4e863b6f4f
BLAKE2b-256 17dbe74c00719de3dc49b3a6ab258932a56389ddfdcaa1c4a1db1c2fa9f7552a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mycelium_agt-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for mycelium_agt-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a543185554e977e4090d9371f0575b382aa9a7fa151368f9c5dc3eaecb90c816
MD5 781cece552d9eb7e54a428a9ed6a8346
BLAKE2b-256 fe60619f264fbe2f5c58bd1e20acbe34327c0aa5b9a40fb8270a3d5ff3b3777f

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