Build an agent#
Your agent calls an app as usual. When an approval is missing, the SDK asks the person through a node, waits for their passkey, and tries again.
In Python#
import os
from allowedby import Agent
agent = Agent(os.environ.get("ALLOWEDBY_NODE", "https://demo.allowedby.com"), tell=print) # tell: show it to the person
app = os.environ.get("APP_URL", "https://notes.demo.allowedby.com")
status, notes = agent.call("GET", app + "/notes", action="notes:read")
print(status, notes)tell receives the approval link and a short code. Show both to the person: they check that the page shows the same
code. Full details are in the Python guide.
In JavaScript#
The same agent, in Node.js, is in the JavaScript guide.
In an agent framework#
| Framework | Python | JavaScript |
|---|---|---|
| MCP server | Yes | Yes |
| LangChain | Yes | Yes |
| OpenAI Agents SDK | Yes | Yes |
| Vercel AI SDK | Yes |
Each one becomes a tool that pauses while the person decides.
What a good agent does#
- Asks for the least. One resource, one action, a limit on the amount.
- Shows the code. A person who sees the code in two places cannot be sent to another request.
- Takes no for an answer. After a refusal, it does not ask again for the same action.
- Keeps approvals. A standing approval is reused, so that the person is not asked twice.