Support staff use the agent to look up invoices. We don't want "delete the March invoices" to work for them at all, approval click or not.
Making sure the in-app agent can't delete invoices
Common question, written up by the Supero team.
1 answer
Take the permission away from the role. The agent runs as the signed-in user, with their token, through the same access checks as the rest of the app. A role the access policy doesn't allow to delete an entity gets an agent that can't delete it either, however the request is phrased.
So give the support role an access rule on the invoice entity that sets all four flags explicitly, with can_delete false. Don't rely on the absence of a rule: with no rule, the role's default_access decides, and with no policy configured every role except viewer gets full create, read, update and delete. readonly_fields and hidden_fields limit what the agent can write and read back in the same way they limit the generated UI.
An entity your schema declares read-only only gets search and get tools, so there is no delete tool for the model to call. The confirmation prompt is not the control here: it only appears on the loop path and expires after five minutes.
Your answer
Know the answer? Sign in to post it. It takes an email address and a 6-digit code.
Sign in to answer