Catalog PyPI
PACKAGE EXPLORERView in registry

acgs-auth0

PyPI

Constitutional Token Governance for AI Agents — ACGS × Auth0 Token Vault

acgsai-agentsauth0governancemacitoken-vault
Versions collected1
Direct dependencies10From release 0.1.1
Last observed20 Oct, 18:11 UTC

README

Version 0.1.1 documentation

acgs-auth0

PyPI Python License: AGPL-3.0

Constitutional token governance for AI agents.

acgs-auth0 bridges Auth0 Token Vault with ACGS MACI governance so the constitution, not the agent, decides which OAuth scopes can be requested. It supports offline pre-flight checks, step-up approval for elevated scopes, and audit logging around every exchange.

Installation

acgs-auth0 supports Python 3.11+.

pip install acgs-auth0
pip install acgs-auth0[langchain]

Quick Start

Define a Scope Policy

# constitution.yaml
token_vault:
  constitutional_hash: "608508a9bd224290"
  connections:
    github:
      EXECUTIVE:
        permitted_scopes: ["read:user", "repo:read"]
        high_risk_scopes: []
      IMPLEMENTER:
        permitted_scopes: ["read:user", "repo:read", "repo:write"]
        high_risk_scopes: ["repo:write"]

Validate and Exchange Tokens

from acgs_auth0 import ConstitutionalTokenVault, MACIScopePolicy
from acgs_auth0.token_vault import TokenVaultRequest

policy = MACIScopePolicy.from_yaml("constitution.yaml")
vault = ConstitutionalTokenVault(policy=policy)

request = TokenVaultRequest(
    agent_id="planner",
    role="EXECUTIVE",
    connection="github",
    scopes=["repo:read"],
    refresh_token="rt_example",
    tool_name="list_issues",
)

validation = vault.validate(request)
assert validation.permitted is True

response = await vault.exchange(request)
print(response.access_token, response.scope)

Step-Up for High-Risk Scopes

request = TokenVaultRequest(
    agent_id="builder",
    role="IMPLEMENTER",
    connection="github",
    scopes=["repo:write"],
    refresh_token="rt_example",
)

validation = vault.validate(request)
print(validation.step_up_required)

Tool Decorator

from acgs_auth0 import get_token_vault_credentials, with_constitutional_token_vault

with_github = with_constitutional_token_vault(
    policy,
    connection="github",
    scopes=["read:user", "repo:read"],
)

@with_github
async def list_issues(repo: str) -> str:
    creds = get_token_vault_credentials()
    return f"using {creds['token_type']} for {repo}"

Configuration

Set these environment variables for live Token Vault exchanges:

VariablePurpose
AUTH0_DOMAINAuth0 tenant domain
AUTH0_CLIENT_IDAuth0 client ID
AUTH0_CLIENT_SECRETAuth0 client secret

Key Features

  • YAML-driven MACI role-to-scope governance.
  • Offline validation through MACIScopePolicy and ConstitutionalTokenVault.validate().
  • Auth0 Token Vault exchange flow with optional step-up handling for elevated scopes.
  • Audit primitives including TokenAuditLog and TokenAccessAuditEntry.
  • Decorator-based integration for LangChain or plain Python callables.

License

AGPL-3.0-or-later. Commercial licensing is available; contact hello@acgs.ai.

Constitutional Hash: 608508a9bd224290

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.15 Apr 202610

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
dislovelhl/acgs-auth0

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:11 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:ad2f644e970182ad29023f8b9c75252b73f9bf496c8fd18068b3724b9dbdde8c