Skip to content

shark-auth/shark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

796 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

SharkAuth

SharkAuth

The open-source identity provider built for AI agents.
One ~29 MB binary. OAuth 2.1 RFC 8693 Token Exchange, and DPoP. Zero config.

Version MIT License Discord Go React SQLite OAuth 2.1 / OIDC


Table of Contents


The Problem

Auth was built for humans clicking buttons. Your agents need something better.

When an AI agent delegates to a sub-agent, the trust chain breaks. Bearer tokens leak. Revocation becomes a mess. Auditors ask "which agent did what?" and you have no answer.

SharkAuth aims to solve this. It treats agents as first-class identities with native delegation, cryptographically bound tokens, and a unified audit trail that tracks every hop from user to resource.


Watch a Demo

shark-dem1o.mp4

Install in 10 Seconds

curl -fsSL sharkauth.com/get | sh

# Or with Go 1.22+
go install github.com/shark-auth/shark/cmd/shark@latest
# Boot. SQLite-embedded, zero config.
shark serve
# => admin UI : http://localhost:8080/admin
# => issuer   : http://localhost:8080

# Dev mode (in-memory DB, magic links to stdout)
SHARK_DEV_MODE=1 shark serve

Why Teams Choose SharkAuth

1. Agent Delegation That Actually Works

Real delegated authority using RFC 8693 Token Exchange. SharkAuth issues may_act_grants that are revocable, time-limited, and hop-constrained. No more prompt-level "trust me" delegation.

SharkAuth Demo
Demo: user delegates to an agent, which delegates to a sub-agent — every hop cryptographically signed and auditable.

2. Tokens Bound to Keys, Not Bearers (RFC 9449 DPoP)

Bearer tokens are a liability. SharkAuth ships Demonstrating Proof-of-Possession by default for tokens it issues. Every SharkAuth token is cryptographically bound to the agent's private key. Stolen via prompt injection or log leak? Useless without the key.

Current: DPoP is enforced on all SharkAuth-issued tokens.
Roadmap: Extend SharkAuth to issue DPoP-bound tokens that agents use to call downstream services directly — so the agent never touches a raw bearer token, even when talking to third-party APIs.

3. Complete Provenance in One Query

One grant_id correlates every token, every hop, and every resource touched. Reconstruct the full lifecycle of an agent's authority instantly. No more "the agent did it" dead ends.

4. One Binary. Zero Dependencies. Anywhere.

SharkAuth is a single static Go binary with embedded SQLite WAL. No Postgres, no Redis, no Docker, no Helm charts.

5. Open Source, Zero Lock-In (MIT)

100% open source. SharkAuth collects only a one-time anonymous install_id ping by default, with telemetry opt-out available. No user, token, session, or auth data leaves your infrastructure. No vendor lock-in, no "free until we change our mind." Your auth stack is yours forever.


What You Get

Category Highlights
Agent Auth RFC 8693 Token Exchange, RFC 9449 DPoP, may_act_grants, cascade revocation, full act chains (depth ≥ 7 observed)
Human Auth Passkeys (FIDO2), Magic Links, MFA (TOTP), Enterprise SSO (SAML 2.0, OIDC), Argon2id passwords
Platform Multi-tenant Orgs, Wildcard RBAC, HMAC-signed Webhooks, grant_id-indexed Audit Logs
Admin UI React dashboard embedded in the binary. One-click revocation for every session, token, and grant

Getting Started

Get the binary via the install script then:

Running Shark

shark serve

Dev mode (no config needed)

SHARK_DEV_MODE=1 shark serve

TypeScript SDK

import { AuthClient } from "@sharkauth/sdk";

const auth = new AuthClient("http://localhost:8080");

// Sign in
const session = await auth.login("alice@co.io", "Strong-Pwd-2026");

Python SDK

from shark_auth import AuthClient

auth = AuthClient("http://localhost:8080")
session = auth.login("alice@co.io", "Strong-Pwd-2026")

Read the full docs


Roadmap

  • Visual Flow Builder — Drag-and-drop auth flows (MFA → SSO → Org Select)
  • Shark Cloud — Managed infrastructure, free to enterprise. Join the waitlist
  • Postgres Mode — Optional external DB for planet-scale deployments
  • Shark Email — Built-in delivery for magic links and MFA codes

Contributing

We welcome contributions! Please read our Contributing Guide to learn about our development process, how to propose bug fixes and improvements, and how to build and test your changes.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.


Community

Shark is a work in progress, expect bugs for now. Built by Raúl R. Gzz. in Monterrey, Mexico. MIT licensed.


License

Distributed under the MIT License. See LICENSE for more information.


If your product ships agents, the auth stack starts here.

⭐ Star this repo · ☁️ Join Cloud Waitlist · 💬 Join Discord