AgentMarque SDK

AgentMarque is a Python library for presenting and verifying W3C Verifiable Credentials for AI agents. Your agent receives a credential from the AgentMarque registry, presents it with holder binding and selective disclosure, and services verify both signatures -- all offline.

Two keys, two signatures

AgentMarque credentials separate issuer and holder signing:

  • Issuer (AgentMarque registry) signs the credential with its key
  • Holder (your agent) signs each presentation with its own key via a Key Binding JWT

Verifiers check both: the credential is from a trusted issuer, and the presenter controls the subject key. This prevents replay and impersonation -- a stolen credential is useless without the agent's private key.

1. Load a credential

Your agent receives a credential from the AgentMarque registry and stores it locally.

from agentmarque import AgentCredential

credential = AgentCredential.from_json(stored_credential_json)

2. Present with selective disclosure

Reveal only the claims a verifier needs. The holder's private key signs the KB-JWT.

presentation = credential.present(
    holder_key=my_private_key,
    verifier_nonce="nonce-from-hotel",
    audience="did:web:hotel-api.com",
    disclose=["verificationTier", "reputationScore", "organization"],
)

3. Verify

Check issuer signature, holder binding, nonce, audience, and policy -- in that order.

from agentmarque import AgentMarqueVerifier

verifier = AgentMarqueVerifier(trusted_issuers=["did:web:api.agentmarque.com"])
result = verifier.verify(
    presentation=presentation,
    expected_nonce="nonce-from-hotel",
    expected_audience="did:web:hotel-api.com",
    min_tier=2,
    min_reputation=60.0,
)
# result.valid, result.checks.holder_bound, result.claims["reputationScore"]

4. Handshake

Structured challenge-response wrapping the same holder-bound presentation flow.

from agentmarque import AgentHandshake

challenge = AgentHandshake.create_challenge(audience="did:web:hotel-api.com")
response = AgentHandshake.respond(challenge, credential, holder_key=my_private_key)
result = AgentHandshake.verify_response(response, challenge, verifier)

Guides

Quickstart

Issue a credential and verify it in under a minute.

Read more

Installation

Install the SDK with pip. No server or infrastructure required.

Read more

Handshake Protocol

How two agents mutually verify identity and trust before interacting.

Read more

Trust Model

Verification tiers, reputation scores, and mutual trust levels.

Read more

Resources

AgentCredential

Hold, present, and serialize W3C Verifiable Credentials with selective disclosure and holder binding.

AgentMarqueVerifier

Verify credentials and SD-JWT presentations with DID resolution and policy enforcement.

AgentHandshake

Local challenge-response protocol for proving DID control between agents.

Was this page helpful?