Observed since 20 Oct, 21:31 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Library-first authentication and authorization SDK for AI agents
Unified SDK and local control plane package for Agent Auth.
You can now create project-scoped tokens from:
agentauth token createThese tokens support one visible token model with richer internal semantics:
purpose=sync for registration and sync flowspurpose=runtime for runtime execution flowspurpose=automation for service or CI style automationagent_id binding for runtime-oriented tokensRuntime authorization now enforces stronger execution binding checks for project-scoped flows:
project_id, agent_id, and purpose fields, with scope-based fallback for older tokensUse the resulting token in code directly:
from agent_auth.client import AuthAPIClient
client = AuthAPIClient(
base_url="http://127.0.0.1:8002",
token="YOUR_PROJECT_TOKEN",
)
Or store it locally for CLI + SDK reuse:
agentauth login --base-url http://127.0.0.1:8002 --token YOUR_PROJECT_TOKEN --email admin@agentauth.dev
agentauth token create \
--project ai-platform \
--name research-runtime-token \
--purpose runtime \
--agent-id research-agent-01 \
--scope docs.read
Then use it directly in code:
from agent_auth import AuthAPIClient
client = AuthAPIClient(token="YOUR_RUNTIME_TOKEN")
ctx = client.execution_context()
print(ctx.project_id)
print(ctx.agent_id)
print(ctx.context.get("token_purpose"))
agentauthlayer helps you:
This package now ships as a unified developer install containing:
pip install agentauthlayer
postgres or sqlite via STORAGE_BACKEND env variables.admin, member, and viewer roles per-project.agentauth dev, agentauth server status, and agentauth server stop for seamless local testing.For a local developer setup, start Agent Auth with one command:
agentauth up
This starts the packaged local control plane on http://127.0.0.1:8002 by default.
If you want a different port:
agentauth up --port 8014
For a fresh deployment:
Open the UI with:
agentauth ui --base-url http://127.0.0.1:8002
Then log in once:
agentauth login --base-url http://127.0.0.1:8002
This stores local credentials so your code can connect without manually pasting a token every time.
Useful follow-up commands:
agentauth whoami
agentauth logout
agentauth ui
agentauth dev
agentauth server status
agentauth server stop
If the deployment has not been initialized yet, agentauth login will tell you to finish setup in the UI first.
from agent_auth import register_tool, register_agent, require_permission
@register_tool(action="math.compute", description="Run approved math jobs")
@require_permission("math.compute", resource="math/basic")
def add(a: int, b: int, agent_id: str | None = None, role: str | None = None, context: dict | None = None):
return a + b
register_agent(
agent_id="math-agent",
name="Math Agent",
owner="you@company.com",
role="research_agent",
project_id="ai-platform",
scopes=[],
)
agentauth sync --module your_module_name
This imports the module, discovers registered tools and agents, syncs capability definitions, and creates agents through the control plane.
from agent_auth import AuthAPIClient
client = AuthAPIClient()
agent = client.create_agent(
agent_id="research-bot-01",
name="Research Bot 01",
owner="vaibhav@company.com",
role="research_agent",
scopes=[],
project_id="ai-platform",
)
print(agent)
If you prefer non-interactive configuration, the SDK also supports environment variables:
export AGENT_AUTH_URL=http://127.0.0.1:8002
export AGENT_AUTH_TOKEN=YOUR_ADMIN_OR_SERVICE_TOKEN
AGENT_AUTH_TOKEN is typically a bearer token, often represented as a long JWT string.
Recommended usage:
agentauth login for local human developer workflowsAGENT_AUTH_TOKEN for CI, automation, or service-driven executionIf an env token expires, requests will fail until you replace it or log in again.
Avoid committing tokens into source control or long-lived shared .env files.
Resolution order used by AuthAPIClient():
agentauth loginclient.sync_tools([
{"action": "tool.search_web", "description": "Search the web"},
{"action": "docs.read", "description": "Read protected docs"},
])
decision = client.evaluate(
principal_id="research-bot-01",
action="tool.search_web",
resource="web/*",
role="research_agent",
)
print(decision)
agent = client.get_agent("research-bot-01")
print(agent)
result = client.delete_agent("research-bot-01")
print(result)
CLI equivalent:
agentauth delete-agent research-bot-01
This package provides:
agent_auth)agentauth upauth_app)The package naming model is:
agentauthlayeragentauthagent_authThe import path remains:
from agent_auth import ...
while the published package name is:
pip install agentauthlayer
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.14 | 20 Jul 2026 | 13 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 21:31 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:6a1140e28ca93bbda6c4c5ece501cdfc69dd21aff954423492d1d734382c075a