Open source · Self-hostable

Access grants, built like infrastructure.

GrantLayer is an open-source, multi-tenant system for issuing time-boxed access grants, enforcing them through a policy engine, and recording every decision in a cryptographically verifiable audit trail.

Apache-2.0 licensed · FastAPI · SQLAlchemy · PostgreSQL · Redis

Capabilities

Everything you need to run access grants in production.

Each of these is shipped and tested today — not a roadmap. Authentication, policy, isolation, and audit are built in, not bolted on.

Verifiable audit chain

Every event is hash-chained to the one before it. Tampering breaks the chain, and verification is a single pass over the log.

Structural multi-tenancy

Tenant and workspace boundaries are enforced in the data layer with fail-closed defaults — isolation by construction, not convention.

OIDC SSO

Bring your own identity provider. Validated tokens, JWKS caching, and strict issuer/audience checks come standard.

Scoped API keys

Issue fine-grained, revocable keys with explicit scopes. Enforcement is centralized so a key can never exceed what it was granted.

OPA policy engine

Authorization decisions are delegated to Open Policy Agent and fail closed — if policy can't be evaluated, access is denied.

Signed webhooks

Outbound events are signed and SSRF-protected, so downstream systems can trust both the source and the payload.

GDPR export & erase Tiered rate limiting Python & TypeScript SDKs OpenTelemetry traces Helm chart Cursor-paginated audit API
Tamper-evident by construction

An audit log you can actually prove.

Each audit event carries the SHA-256 hash of the event before it. Records form a chain: alter one field and every hash downstream stops matching.

Grants themselves are independently Ed25519-signed over their immutable fields, so a stored grant can't be silently rewritten either. Verification is deterministic and runs in a single pass.

block #1042grant.created
payload subject=agent-7 · action=deploy
prev    a3f1…7e0b
hash    9c4d…b21a
block #1043action.approved
payload resource=service:payments · ok
prev    9c4d…b21a
hash    5e8a…f03c
block #1044grant.revoked
payload subject=agent-7 · by=operator
prev    5e8a…f03c
hash    b770…1d92
✓ chain verified · 3 blocks · 0 breaks ✕ chain broken at block #1043 · prev-hash mismatch
Architecture

A boring, dependable stack — on purpose.

GrantLayer is a fully async FastAPI service with a clean repository and service-layer separation, SQLAlchemy ORM throughout (no raw SQL), and PostgreSQL and Redis for state and rate limiting. The same code runs on SQLite for local development.

FastAPI async API SQLAlchemy ORM · repositories PostgreSQL system of record Redis rate limiting · queues Open Policy Agent authorization Alembic migrations OpenTelemetry observability
Self-host

Running in one command.

Clone the repository and bring up the full stack with Docker Compose. No account, no waitlist, no managed plan — it's yours to run, on your own infrastructure.

bash
# clone and start the full stack
git clone https://github.com/discodone/grantlayer
cd grantlayer
docker compose up -d

# the API is live on localhost
curl http://localhost:8765/health
# → {"status":"ok","service":"grantlayer"}
SDKs & API

An API-first surface, in your language.

Every capability is reachable over a versioned REST API documented with OpenAPI. The Python SDK is published on PyPI — pip install grantlayer. The TypeScript SDK ships in the repository and builds from source; it is not yet published to npm.

list_grants.ts
// built from source: sdk-js/ in the repo (not yet on npm)
import { GrantLayerClient } from "grantlayer-sdk";

const gl = new GrantLayerClient({
  baseUrl: "http://localhost:8765",
  apiKey: process.env.GRANTLAYER_API_KEY!,
});

// list grants — server-side scoped to the key's workspace
const grants = await gl.listGrants({ limit: 20 });

A note on how this was built

GrantLayer is built and maintained by a solo developer. Much of it was implemented by autonomous AI agents working issue-by-issue, with every change held to the same gate — a full passing test suite, type checks, and lint — and reviewed across multiple independent models before merging. For current test, coverage, and version numbers, see the repository.

Read the code. Run it yourself.

GrantLayer is open source under the Apache 2.0 license. Clone it, audit it, and self-host it today.