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.0.tar.gz (11.0 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.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mycelium_agt-0.1.0.tar.gz
  • Upload date:
  • Size: 11.0 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.0.tar.gz
Algorithm Hash digest
SHA256 28898728218827d6694028760899c8837e6f27dfbf500a3120a5069cdda3a001
MD5 735c1a8300d15f60d04e64eb7c64d744
BLAKE2b-256 082bbdc0266976aa9796f427848eff75060dddc1858b13f355eb8b145046ad4c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mycelium_agt-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6abb5daa6ab865f27bc23b0aac264e3fa6facea2be22a1eb013422d7e0103e9f
MD5 bb3339bd0d1a4e61a96c22f87fd13367
BLAKE2b-256 9912d193d15d8b1ace792d93c928ee15b89a90b0f86e2b16bc4f74a60a907cee

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