Skip to main content

Grantstamp

DOI

Agents ask first. Grantstamp™ is an open ownership registry and check protocol for AI agents. Owners publish fingerprints and a policy for their software and game builds, but never the files themselves. Before an agent decompiles, ports, modifies or redistributes a file, it checks the registry. It gets back who owns the file, what the owner allows for that exact use, a confidence band and a signed receipt.

Status: prototype 0.2. This version works end to end and is tested and benchmarked, but it is not hardened for heavy traffic yet, and interfaces may change before 1.0. Live status: grantstamp.io/status. What holds and what does not: grantstamp.io/security.

Website grantstamp.io · Docs grantstamp.io/docs · Search stamps grantstamp.io/stamps · Public registry https://registry.grantstamp.io

Why

AI coding agents now compress weeks of reverse-engineering and porting work into hours. Owners have no machine-readable way to tell those agents "this is mine, and this is what I allow." Today's safeguards are blunt rules: they cannot tell a pirate from the owner's own contractor. Grantstamp gives agents precise, owner-supplied data. It flags copies and unblocks licensees, and it alerts the owner within seconds. Read docs/01-problem.md.

How it works

sequenceDiagram
    participant O as Owner (CLI, local)
    participant R as Grantstamp registry
    participant A as AI agent (MCP / hook / API)
    O->>O: fingerprint build locally (hashes only)
    O->>R: register stamp: fingerprints + policy (signed)
    A->>A: fingerprint the user's file locally
    A->>R: POST /v1/check {digests, use: "port", licence tokens?}
    R-->>A: owner, policy decision, band, guidance, signed receipt
    R-->>O: alert (match / probing / conflict) via webhook

Every file gets a layered identity. No single fingerprint survives everything, so Grantstamp combines several:

Layer What it survives
sha256 nothing; exact copies only, zero false positives
chunks, content-defined chunking patches, edits, embedding in a bigger file
strings, printable strings and code literals recompiling, other compilers, stripping, porting, decompiling
symbols, identifier-like strings weak evidence on its own, so stricter thresholds
winnow, normalised code k-grams reformatting and renaming in source code
dhash, perceptual image hash re-encoding and resizing of textures and art
markers, embedded notice or signed grantstamp.json anything that keeps strings; also visible to agents reading the file

Matches are graded exact > high > medium > low. Only high and exact can produce a hard deny. A medium-confidence match turns the owner's deny into ask.

Quick start

pip install grantstamp           # client, CLI, MCP server, agent hook (Apache-2.0)
pip install grantstamp-server    # only to run a registry (AGPL-3.0)
python examples/demo.py          # the whole story, locally, in ~10 seconds (needs both)

Owners

grantstamp keygen                                   # your identity: ~/.grantstamp/owner.key
grantstamp owner create --name "Starfall Studio" --url https://starfall.example
grantstamp owner domain starfall.example            # prints a DNS TXT record / .well-known file
grantstamp owner verify starfall.example
grantstamp register ./build --title "Starfall Courier" --version 0.9.4 \
    --preset standard --contact legal@starfall.example --manifest
grantstamp marker stamp_… --lang cpp                 # notice to compile into the next build
grantstamp owner webhook https://hooks.slack.com/services/… --format slack
grantstamp token issue --stamp stamp_… --to "PortCo" --uses port,modify --days 90
grantstamp alerts
grantstamp search starfall                           # listed stamps; add --unlisted when registering to stay out
grantstamp qr stamp_… --out stamp.png                # QR code for the stamp's public page

AI agents and tools

  • MCP server (Claude Desktop, Claude Code, Cursor, VS Code): run pip install grantstamp, then point your client at the grantstamp-mcp command. See integrations/.
  • Claude Code hook: grantstamp-hook runs before Read, Edit and Bash on binaries and game files. It denies, asks or allows based on the owner's policy. See integrations/claude-code.
  • HTTP API: POST /v1/check. Sign requests with RFC 9421 HTTP Message Signatures (Web Bot Auth compatible) for higher limits. See spec/grantstamp-protocol-v0.1.md.
  • Command line: grantstamp check path/to/file --use port --exit-code.
  • Browser: the website's check page fingerprints a file in the browser; the file never leaves it.

Check the registry's records yourself

grantstamp audit stamp_…

Owners sign every stamp, the registry keeps a hash-chained public log, and a daily job saves the log head outside the registry and timestamps it. grantstamp audit verifies all of it and exits with an error if anything is off. See Verify a stamp yourself.

Run a registry

pip install "grantstamp-server[postgres]"
grantstamp serve --host 0.0.0.0 --port 8000 --db sqlite:///grantstamp.db --public-url https://registry.example
# or: docker compose up -d   (Caddy + HTTPS), or render.yaml + a free Neon Postgres: docs/05-integrations.md

Benchmark (prototype scale)

Detection results are in bench/RESULTS.md (python bench/run_bench.py); speed and storage are in bench/LOAD.md (python bench/load_bench.py).

  • Detection. A toy game was recompiled with gcc and clang at -O0 to -O3 with LTO, stripped, byte-patched, given half-rewritten strings, ported as a folder, or turned into synthetic decompiler output. Every variant matched high or exact.

  • Cross-matches. 400 Linux system executables were checked against 60 others registered under 60 owners. There were 0 medium-or-higher matches across different source packages. All 21 medium or high matches were programs from the same source package, which really do share code.

  • Speed and size. With 3,000 real executables registered on PostgreSQL, on one 2-CPU machine: a check takes 15 ms at the median and 87 ms at the 95th percentile, and each registered executable costs about 76 KB of database.

Documentation

The documentation is published, by version, at grantstamp.io/docs. The sources are here:

Owners · Agents · Verification Register a stamp, connect an agent, check the registry's records
01 Problem What happened, why speed matters, where safeguards fail
02 Solutions Each original idea, what breaks, the fix that holds
03 Architecture Components, data flow, security boundaries
04 Implementation Algorithms, scoring, API and CLI reference
05 Integrations Every account and service needed, step by step
Threat model · Spec Attacks and mitigations; the protocol

What Grantstamp is not

It is not DRM and not a court. It does not stop leaks, make anything uncrackable or decide what is legal. It puts the owner's signed claim and policy in front of a cooperating agent at the moment it is about to act, and tells the owner fast.

Citing

Each release is archived on Zenodo with a DOI (badge above) and in Software Heritage. Citation details are in CITATION.cff; GitHub's "Cite this repository" button uses it.

License

The client library, CLI, MCP server, agent hook and website are Apache-2.0 (LICENSE). The registry server in server/ (grantstamp-server) is AGPL-3.0-only (server/LICENSE): anyone who runs a modified copy for others must publish their changes. Agents and tools that only check the registry need only the Apache-2.0 client. The protocol specification is CC BY 4.0.

Copyright 2026 The Grantstamp Authors. "Grantstamp" and the Grantstamp seal are trademarks of the project owner; neither licence grants trademark rights. See TRADEMARK.md.

Metadata

Release files for grantstamp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for grantstamp 0.2.0
File Size Uploaded Provenance Actions
grantstamp-0.2.0.tar.gz 880.3 kB With provenance Details for grantstamp-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for grantstamp 0.2.0
File Interpreter ABI Platform Actions
grantstamp-0.2.0-py3-none-any.whl Python 3 none any Details for grantstamp-0.2.0-py3-none-any.whl

Total release size: 1.8 MB

Release files / grantstamp-0.2.0.tar.gz

Download URL grantstamp-0.2.0.tar.gz
Size 880.3 kB
Tags Source
SHA-256 checksum
How to use checksums
01c979340295feaa9e21942b6ca355d66d7fe337e26c8b0d6de7bd15b0484b49
BLAKE2b-256 checksum
How to use checksums
4e7dce705fbad4e1f0f2bacb3099578da53c2cd62032aa8b381f84d1d0a77226
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / grantstamp-0.2.0-py3-none-any.whl

Download URL grantstamp-0.2.0-py3-none-any.whl
Size 908.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44c1504477594a89592d4cca54e4c8533c7b42f91c02bd78cb2f5b3766126f34
BLAKE2b-256 checksum
How to use checksums
4f0988a39a6c32cbbe4f89cd04562e6197d9cfadc590056aee282d55166677cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for grantstamp 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for grantstamp-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page