Introduction to Agent OTP
Agent OTP is a lightweight service that provides one-time, scoped permissions for AI agents. It enables human-in-the-loop approval workflows for sensitive operations while allowing safe operations to be auto-approved.
Why Agent OTP?
As AI agents become more autonomous and capable, they need access to sensitive resources like email, databases, financial systems, and more. Traditional authentication methods (API keys, OAuth tokens) grant broad, persistent access that doesn't match the ephemeral, scoped nature of agent operations.
Agent OTP solves this by providing:
- Scoped permissions - Define exactly what an agent can do with each request
- Ephemeral tokens - Tokens expire after use or timeout, eliminating persistent credential risks
- Human-in-the-loop - Configure policies to require human approval for sensitive operations
- Full audit trail - Every request, approval, and usage is logged for compliance
How it works
Request
Agent requests permission for a specific action
Evaluate
Policy engine determines if approval is needed
Approve
Auto-approve or send to human for review
Execute
Agent uses one-time token to perform action
Quick example
import { AgentOTPClient } from '@orrisai/agent-otp-sdk';
const otp = new AgentOTPClient({
apiKey: process.env.AGENT_OTP_KEY,
});
// Request permission to send an email
const permission = await otp.requestPermission({
action: 'gmail.send',
resource: 'email:client@example.com',
scope: {
max_emails: 1,
},
context: {
reason: 'Sending invoice to client',
},
waitForApproval: true,
});
if (permission.status === 'approved') {
// Token is scoped to exactly this operation
await sendEmail({
to: 'client@example.com',
otpToken: permission.token,
});
}Key features
Policy Engine
Define rules to auto-approve safe operations and require human review for risky ones.
Multi-channel Notifications
Get approval requests via Telegram, email, webhooks, or the web dashboard.
Framework Agnostic
Works with LangChain, CrewAI, AutoGen, or any custom agent framework.
Audit & Compliance
Full audit trail of all permissions, approvals, and usage for compliance needs.