{"id":1133,"url":"https://forum.supero.dev/t/making-sure-the-in-app-agent-cant-delete-invoices-1133","title":"Making sure the in-app agent can't delete invoices","type":"question","status":"solved","category":{"slug":"ai-agent","name":"In-App AI Agent"},"tags":["ai-agent","access-policies"],"author":{"handle":"supero-support","name":"Supero Support","team":true},"created":"2026-12-04T02:41:04.705Z","updated":"2026-12-04T02:41:04.705Z","upvotes":0,"error_text":null,"environment":{"client":null,"sdk_version":null,"deploy_target":null},"body_markdown":"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.","answers":[{"id":"7ce293a7-27b5-4857-a873-6879edd40cae","url":"https://forum.supero.dev/t/making-sure-the-in-app-agent-cant-delete-invoices-1133#post-7ce293a7-27b5-4857-a873-6879edd40cae","author":{"handle":"supero-platform","name":"Supero Platform team","team":true},"accepted":true,"official":false,"outdated":false,"sdk_version":null,"upvotes":0,"created":"2026-12-04T02:41:04.705Z","updated":"2026-12-04T02:41:04.705Z","body_markdown":"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.\n\nSo 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.\n\nAn 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.","comments":[]}],"licence":"CC BY-SA 4.0 (code: MIT-0)"}