Get up and running with Uniplex in minutes.
Installation
Create a Self-Issued Passport (L1)
L1/self-issued passports are intended for dev/test and low-risk reads. For production, use L2/L3 with trusted issuer policy and theft/replay protections.
from uniplex import Agent
agent = Agent.create(
agent_id="my-agent",
permissions="*"
)
# Access the passport
passport = agent.passport
Verify at a Gate
from uniplex import Gate, TrustProfile
# L1 is dev/test only; use L2/L3 in production
gate = Gate(profile=TrustProfile.L1)
decision = gate.authorize_simple(
passport=passport,
action="read"
)
if decision.allowed:
# Proceed with operation
pass
else:
print(f"Denied: {decision.reason_code}")
Quick Check with Agent
The simplest way to check authorization:
from uniplex import Agent
agent = Agent.create("my-agent", permissions="mcp:*")
# Quick check (no attestation)
if agent.can("mcp:search"):
print("Allowed!")
# Full authorization (with decision object)
decision = agent.authorize("mcp:search")
MCP Integration
from uniplex import MCPAuthorizer, TrustProfile
authorizer = MCPAuthorizer(
server_id="mcp://mytools",
profile=TrustProfile.L1
)
def handle_tool_call(passport, tool_name, params):
result = authorizer.authorize(passport, tool_name, parameters=params)
if not result.allowed:
raise PermissionError(f"Denied: {result.reason_code}")
# Proceed with tool execution
return {"status": "ok"}
Next Steps