Skip to main content

Approvals

Before your agent does something risky, ask a person. The agent sends a request, a person approves or denies it in Autessa, and the agent continues with the answer.

When to use it​

  • Refunds, payments, or account changes above a limit.
  • Sending data or email to someone new.
  • Any action you want a named person to sign off on.

Quickstart​

  1. Get a free API key. New accounts get $100 of free credits for your first month, no card needed. This developer key works for this feature; see Keys.
  2. Call request_approval with a title, details, and a timeout. You get an approvalId.
  3. Call get_approval until decision is no longer PENDING.
curl -X POST https://api.autessa.com/clients/agent-tools/request_approval/invoke \
-H "Authorization: $AUTESSA_API_KEY" -H "Content-Type: application/json" \
-d '{"input": {"title": "Refund $480 to order 1042", "details": "Customer reports the item arrived damaged.", "timeoutSec": 900}}'

curl -X POST https://api.autessa.com/clients/agent-tools/get_approval/invoke \
-H "Authorization: $AUTESSA_API_KEY" -H "Content-Type: application/json" \
-d '{"input": {"approvalId": "apr_8f2c"}}'

How it works​

  • request_approval takes title and timeoutSec, plus optional details and approvers (member emails or group names; leave it out to use your company's approvers). It returns approvalId.
  • get_approval returns decision: PENDING, APPROVED, DENIED, or EXPIRED, plus by and at once someone decides.
  • If nobody decides before the timeout, the decision is EXPIRED. Treat it as a no.
  • The AI Application Firewall can also return REQUIRE_APPROVAL on its own. Use these tools to carry it out.

Libraries​

LanguagePackageCall
Pythonautessa-approvalsApprovals().request(title, details=None, approvers=None, timeout_sec=3600), get(approval_id), wait(approval_id)
TypeScript@autessa/approvalsnew Approvals().request({ title, details?, approvers?, timeoutSec }), get(approvalId), wait(approvalId), requestAndWait(req)
Javacom.autessa:autessa-approvalsApprovals.fromEnv().request(title, details, approvers, timeoutSec), get(approvalId), await(approvalId), requestAndWait(...)
from autessa.approvals import Approvals

approvals = Approvals() # reads AUTESSA_API_KEY
ask = approvals.request("Refund $480 to order 1042", details="Item arrived damaged.", timeout_sec=900)
decision = approvals.wait(ask.approval_id)
print(decision.decision, decision.by)

wait returns once the decision is APPROVED, DENIED, or EXPIRED. Treat anything but APPROVED as a no.

The libraries are in private preview and not yet on PyPI, npm, or Maven Central. Install from GitHub as each library's README describes, for example:

pip install "autessa-core @ git+https://github.com/Autessa-Inc/autessa-python#subdirectory=packages/autessa-core"
pip install "autessa-approvals @ git+https://github.com/Autessa-Inc/autessa-python#subdirectory=packages/autessa-approvals"

Limits​

  • Poll no faster than every few seconds. The libraries' wait does this for you.
  • Per-key rate limits apply. See API keys and scopes.

API reference​

Agent Tools API

Benchmarks​

None for approvals. See Benchmarks.

Example​