Advanced security

Pause a sensitive action for human approval.

Use REQUIRE_APPROVAL when an action may be valid but should not happen without a person checking the exact operation.

When should you use it?

Issue a refundSend an external emailDelete a recordChange production data

1. Mark the tool for approval

permissions = {
    "customer.read": "ALLOW",
    "payment.refund": "REQUIRE_APPROVAL",
}

The first refund attempt stops before the refund function runs. A request appears under Dashboard → Approvals.

2. Catch, review and retry

from quasentra import ApprovalRequired

try:
    refund_result = secured_refund("PAY-100", 5000)
except ApprovalRequired as pending:
    print("Approve this request in the Quasentra dashboard")
    wait_until_your_application_is_ready_to_retry()

    with security.resume(pending):
        refund_result = secured_refund("PAY-100", 5000)

Your application decides when to retry—for example after an operator confirms approval in its workflow. The retry must contain the same action and arguments.

What makes the approval safe?

  • It belongs to one workspace, agent and action.
  • It is bound to the exact arguments that were reviewed.
  • It expires after a limited time.
  • It is consumed once and cannot approve a second execution.
  • Changing Rs. 5,000 to Rs. 50,000 creates a different operation and is rejected.

Implementation rules

Do not automatically approve requests, do not create a permanent ALLOW after one approval, and do not rebuild arguments from untrusted text between review and retry. Show the reviewer the customer, amount, destination and other business context needed to make a real decision.