Today we’re introducing the Indent API – the easiest way to add human approvals to any software.
With it, you can secure your applications, internal tools, and AI agents with a general-purpose interface for requesting human review. Reduce the risk of your most dangerous code paths by defining policy checkpoints that can either be automated or require human approval.
import { approval } from '@indent/approvals'async function resetPassword({ actor, user, reason }) {await approval({reason,petitioners: [{ kind: 'staff', email: actor.email }],resources: [{kind: 'action',id: `reset-password:${user.id}`,displayName: `Reset Password - ${user.name}`,altIds: [user.id],},],},{ retries: 10, wait: 1000 }) // wait for max 10 seconds// continue}
Developers who need to secure potentially dangerous API operations like:
With Indent, we've built a system that lets you define approval checkpoints that can either be automated or require human approval.
It provides a general-purpose interface for requesting human review, and we're making it available to developers to use in their code.
npm install @indent/approvalspip install approvals
Request approval. When you want to request approval, call the approval
function in the SDK. You can specify the reason for the request, the people who need to approve it, and the resources that are being accessed. Requests can also be auto-approved based on a set of policy conditions.
Wait for approval. The approval
async function will wait for the request to be approved. You can specify how long to wait, how many times to retry, or if you want it to be resumable.
Continue. Once the request is granted, the approval
promise will resolve. You can continue with the rest of your code.
You can use await approval
in your code anywhere that you need approvals. The API will check if the request can be auto-approved or if it requires human review, then Indent handles all the notificatoin, time-bounded state management, retry, and other distributed systems logic.
Here's an example for LangChain using callbacks to require approval before running shell commands:
from approvals.using.langchain import HumanApprovalCallbackHandlerfrom langchain.tools import ShellTooltool = ShellTool(callbacks=[HumanApprovalCallbackHandler()])print(tool.run("ls /usr"))
$ python tool.py✳︎ Requesting approval for: ls /usr⏵ Requested approval↳ Waiting for approval... (2s elapsed)↳ Waiting for approval... (4s elapsed)↳ Waiting for approval... (8s elapsed)✅ GrantedX11X11R6binliblibexecsbinsharestandalone
We’ve designed the API to be both simple for anyone to use but also flexible enough to give engineers what they need to secure their products and tools.
Every part of Indent is designed and built with engineers in mind. You can now request access in order to integrate approvals into your product, internal tools, or AI agents.
Here’s a preview of what’s next:
Interested in exploring the API? Join our private beta. Private beta starting November 2023. Open beta in December 2023.