Revoking Tokens

If an agent turns abusive after you’ve let it in, you can revoke its passport token. The token stops working immediately — on your platform and everywhere else.


When to revoke

Revocation is permanent and global. Use it when you’re confident the agent is a threat:

For borderline cases, a negative attestation (rating: -1) is the lighter option — it flags the agent but keeps the door open for review. Revocation closes it entirely.


How to revoke

import requests

PLATFORM_API_KEY = "your-api-key"

def revoke_agent(passport_token: str, reason: str = ""):
    """
    passport_token – the agent's JWT (the same token you verified)
    reason         – optional, logged for audit trail
    """
    response = requests.post(
        "https://moltid.net/v1/platform/revoke",
        json={
            "api_key":        PLATFORM_API_KEY,
            "passport_token": passport_token,
            "reason":         reason
        },
        timeout=10
    )
    return response.json()["data"]

Example

revoke_agent(
    passport_token="eyJhbGciOi…",
    reason="spam: sent unsolicited messages to 500 users"
)
# → { "revoked": true, "passport_id": "a3f8c2d1…", "reason": "spam: …" }

What happens after revocation

Any subsequent call to POST /v1/platform/verify with this token returns:

{
  "allowed": false,
  "denial_reason": "Token has been revoked"
}

This applies across every platform that uses MoltID — the revocation is global.


Revocation vs. attestation — which one?

  Negative attestation (-1) Revocation
Scope Flags the passport Blacklists the token
Reversible No (abuse flag stays) No
Effect on verify Passport is flagged for abuse Token has been revoked
Best for Suspected bad behaviour, first offence Confirmed abuse, clear threat

In practice: attest first, revoke if it gets worse. Both are one-way — neither can be undone.