Skip to main content

Verifiable agent-run attestations on the Mantle EVM L2. Hash an agent's JSONL audit log into a Merkle root, sign it, post it on-chain, and prove a single run later.

Project description

mantle-agent-attest

Verifiable AI-agent-run attestations on the Mantle EVM L2. Built for the Mantle Turing Test Phase 2 hackathon on DoraHacks.

The pitch

AI agents are increasingly running unattended (scraping, payments, trades). The Turing-test question becomes: how do you prove a given log came from a specific agent and wasn't doctored?

mantle-agent-attest does this in three steps:

  1. Hash the agent's JSONL audit log (e.g. from birddog or agentleash) into a Merkle root.
  2. Sign the root with the agent's EVM key (personal-sign).
  3. Post the (runId, root, signature) triple on-chain to a tiny AgentAttestationRegistry contract on Mantle.

Anyone can later verify:

  • "this single event was part of run X" (Merkle inclusion proof)
  • "run X was signed by agent Y" (ecrecover on-chain)

Install

pip install mantle-agent-attest                # core (Merkle + sign)
pip install "mantle-agent-attest[onchain]"     # + web3 for on-chain submit/read

Python 3.10+.

Quickstart (offline)

import json
from mantle_agent_attest import build_attestation, verify_inclusion

# any JSONL agent log works (birddog, agentleash, your own)
events = [json.loads(line) for line in open("runs/watchdog.jsonl")]

att = build_attestation(
    events,
    run_id="scrape-2026-05-20",
    signer_key="0x...",   # your agent's EVM private key
)
print(att.root_hex, att.signature, att.signer)

# prove that one event was part of the run:
target = events[3]
proof  = att.proof_for(3)
assert verify_inclusion(target, proof, att.root)

Publish on-chain (Mantle Sepolia)

# 1. Deploy the registry once (forge / hardhat / foundry — see contracts/README.md)
forge create \
  --rpc-url https://rpc.sepolia.mantle.xyz \
  --private-key $YOUR_KEY \
  contracts/AgentAttestationRegistry.sol:AgentAttestationRegistry

# 2. Use the deployed address to attest a run
export MANTLE_REGISTRY=0xDeployedRegistryAddress
export AGENT_KEY=0xYourAgentPrivateKey
python examples/submit_attestation.py runs/watchdog.jsonl --run-id scrape-2026-05-20

Mantle Sepolia testnet has free gas via the public faucet.

Why Mantle

  • Cheap, fast EVM L2 — attestations cost cents, not dollars
  • Standard ecrecover on personal-sign, so any wallet can verify
  • The contract is ~50 lines of Solidity; no admin, no upgrade path

Companion libraries

mantle-agent-attest is the on-chain verification layer for the @mukundakatta agent-stack:

  • birddog — audited Bright Data egress (produces the JSONL we hash)
  • agentleash — USD/call budget + tool-arg gate (also JSONL)
  • recruitertriage — small-LM recruiter inbox triage

You can attest any of these audit logs without code changes.

Security notes

  • The deployed registry is permissionless. Anyone can post any (runId, root, sig), but signer is recovered from the sig, so impersonation isn't possible.
  • runId is locked on first submit; pick collision-resistant IDs.
  • block.timestamp on ts is approximate (~12 sec on Mantle).
  • This library is alpha. Don't use the example key on mainnet.

License

MIT

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

mantle_agent_attest-0.1.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

mantle_agent_attest-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mantle_agent_attest-0.1.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for mantle_agent_attest-0.1.0.tar.gz
Algorithm Hash digest
SHA256 790e40fe9d62dbba6007d3b72b7e8158fce970042a9afb8b16b8bd5f3242dc6b
MD5 fe5d25e211c4949ac79db22ece7bcbea
BLAKE2b-256 ae9ba45177492de5088df15752e0c76177e0177fa1e7797164f07e47be3b1e21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mantle_agent_attest-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b14ebcba86cb9bb33bdd23ededada21dae9d9fea3ca454cb3696ad26fade5f54
MD5 cc2d04ba1152b0aa2682ce8e1ee34dd2
BLAKE2b-256 50258be6b7d5efa022632f2f4afe3633e836b7b07d63f380f87b8a0d92eb073d

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