platform_admin developer viewer execute

Authentication that puts identity first

Open-source SIWE authentication with social login, role-based access control, and multi-tenancy. TypeScript & Python SDKs included.

View on GitHub

Every way to sign in

Wallet-native and social login flows, all producing the same JWT identity.

Sign-In with Ethereum

EIP-4361 SIWE messages with nonce protection, domain binding, and automatic signature verification.

Social Login

Any OAuth2 provider with deterministic identity derivation. Users get a consistent identity regardless of how they sign in.

OAuth 2.0 + PKCE

Authorization code flow with S256 code challenge. Hosted sign-in page or bring your own frontend.

WalletConnect

QR-code mobile wallet support via WalletConnect v2. Works with 300+ wallets.

One permission model for everyone

People, AI agents, and applications all share the same role-based access control. A single 6-part permission string governs every action in every tenant.

Person user Agent service App api_key Guardius RBAC evaluate & enforce region : platform : tenantId : resourceType : resourceId : action 6-part permission string — wildcards supported at every level platform_admin developer executor viewer

Groups & Roles

Assign roles to groups or individual identities. Flat groups collect users, agents, and apps. Role assignments bind to a specific tenant — add one role to a group, every member inherits the permissions.

6-Part Permissions

region:platform:tenantId:resourceType:resourceId:action with wildcards at every level. *:forge:acme-corp:documents:*:read lets an agent read all documents in a tenant.

Escalation Guard

Callers cannot grant permissions broader than what they hold. Every role assignment and permission delegation is validated against the caller’s own scope — privilege escalation is structurally impossible.

Mutable Roles

Six default roles — guardius_admin, tenant_admin, platform_admin, developer, viewer, executor — plus custom roles with CRUD APIs. Template variables expand to concrete grants per tenant and platform.

Scenario: AI agent needs deploy access
// 1. Give the agent a "developer" role scoped to one tenant POST /rbac/identities/agent:deploy-bot/permissions { "roleTemplate": "developer", "platform": "forge", "tenantId": "acme-corp" } // 2. Agent tries to deploy — allowed POST /rbac/permissions/check { "identityId": "agent:deploy-bot", "permission": "*:forge:acme-corp:workflows:wf-42:execute" } // → { "allowed": true } // 3. Same agent tries to read billing — blocked POST /rbac/permissions/check { "identityId": "agent:deploy-bot", "permission": "*:forge:acme-corp:billing:*:read" } // → { "allowed": false }

Isolated by default

Each platform gets its own namespace with independent configuration, credentials, and rate limits. Tenants within a platform provide further isolation.

Platform Lifecycle

Register, enable, and disable platforms. Disabling a platform immediately blocks all auth flows — token exchange, refresh, verify, authorize, and social login.

Scoped Tokens

JWTs include platform_id and tenant_id claims for downstream service authorization.

Self-Service Tenants

Create tenants via API with automatic tenant_admin role assignment. Configurable per-identity creation limits.

Origin Allowlists

Per-tenant redirect URI and CORS origin validation enforces OAuth security boundaries.

Structured event tracking

Every authentication, permission check, and security event is captured with structured metadata for auditing and analytics.

Event Aggregation

Time-bucketed daily aggregates with sharded partition keys for high throughput. Query by event type, platform, or wallet address.

Security Event Priority

Security-critical events are preserved under load. Buffer overflow drops non-security events first, ensuring audit trails survive traffic spikes.

Structured JSON Logging

Every log line is a JSON object with timestamp, level, service tag, and structured data. Buffered writes for efficiency, immediate flush on errors.

RBAC Audit Trail

Permission grants, role assignments, group changes, and escalation denials are all emitted as events with full caller context.

Ready-made clients

Type-safe SDKs with automatic token refresh, PKCE handling, and full RBAC support.

TypeScript — browser sign-in
import { AuthService } from '@guardius/sdk'; const auth = new AuthService({ baseUrl: 'https://guardius.penseur.ai', platformId: 'my-app', tenantId: 'my-tenant', }); // 1. User clicks "Sign In" — connect wallet const user = await auth.signInWithWallet(window.ethereum); console.log(user.walletAddress); // 0x1234... // 2. Check what this user can do const canDeploy = await auth.hasPermission( '*:forge:acme-corp:workflows:*:execute' ); // 3. Tokens refresh automatically in the background auth.on('refresh', (user) => updateUI(user));
Python — server-side verification
from guardius_sdk import AuthService auth = AuthService( base_url="https://guardius.penseur.ai", platform_id="my-app", tenant_id="my-tenant", ) await auth.initialize() # 1. Verify the token from an incoming request result = await auth.verify_token_with_server(token) print(result.wallet_address) # 0x1234... # 2. Check permissions before allowing the action allowed = await auth.has_permission( "*:forge:acme-corp:documents:doc-1:read" ) if not allowed: raise PermissionError("Access denied")

JWT done right

RS256 asymmetric signing with automatic key rotation, refresh tokens, and a public JWKS endpoint.

RS256 / JWKS

Asymmetric JWT signing with a public /.well-known/jwks.json endpoint for zero-trust token verification.

Refresh Rotation

One-time-use refresh tokens with automatic rotation. Reuse detection immediately revokes the token family.

Auto-Refresh

SDK-level token lifecycle management. Access tokens refresh transparently before expiration.

Signed Cursors

HMAC-signed pagination cursors for tamper-proof, stateless pagination across all list endpoints.

Defense in depth

Multiple layers of protection against common attacks, from rate limiting to nonce replay prevention.

Rate Limiting

Per-IP sliding window with exponential backoff. Separate limits for auth, token exchange, and admin endpoints.

Nonce Protection

Cryptographic nonces with time-bound expiration prevent replay attacks on SIWE messages.

Subject Revocation

Revoke all refresh tokens for a user with a single timestamp marker. No need to scan or delete individual tokens — instant account-level lockout.

CORS Policy

Dynamic origin allowlist from configuration. Production guard rejects startup if no origins are configured.

Built for these architectures

Guardius shines when you need multiple identity types, tenant isolation, and fine-grained permissions in the same system.

AI Agent Fleet Management

Deploy autonomous agents across customer environments. Each customer is a tenant, each agent gets an agent: identity with permissions scoped to exactly what it needs. The escalation guard ensures no agent can grant itself broader access. Subject-level revocation instantly locks out a compromised agent across all tokens.

agent:deploy-bot → *:platform:acme:deployments:*:execute

DAO Tooling Suite

Each DAO is a tenant. Members authenticate with their wallets via SIWE, and the same identity works across treasury management, proposal voting, and contributor payments. Social login provides an onramp for non-crypto contributors. A contributor who works for two DAOs gets separate scoped roles for each without conflicting permissions.

tenant_admin → multisig signers  |  developer → contributors

Internal Developer Platform

Each engineering team is a tenant managing shared infrastructure. Platform engineers hold platform_ops with broad read access. Teams get developer roles scoped to their resources — CI pipelines, secrets, deployments. CI/CD bots authenticate as agent identities. Self-service tenant creation lets new teams onboard without filing tickets.

groups → move engineers between teams by updating membership

Multi-Studio Gaming Backend

Each studio registers as a platform, each game title is a tenant. Players sign in with wallets for asset ownership or social login for mainstream access — both produce the same JWT identity. Game server bots are agent identities. Origin allowlists enforce that Studio A’s frontend can’t call Studio B’s endpoints.

platform:studio-a → tenant:battle-royale → agent:npc-engine

B2B API Marketplace

API providers register as platforms, enterprise customers are tenants. Each customer gets self-service tenant admin to manage their developers and API keys. The 6-part permission string maps cleanly to API resources. Scoped JWTs let downstream microservices enforce authorization without calling back to Guardius.

*:weather-api:acme-corp:endpoints:forecast:read