Maple

Field Notes, July 31, 2026

Agent Permissions Belong in Code, Not in the System Prompt

A system prompt that says "never issue refunds over $500" is a wish. Put a policy check between the agent and every privileged action, and make it fail closed.

Open the instructions for any agent you have in production and search for the words "never" and "must not." Every hit is a permission you are asking a language model to enforce on itself. Those rules should move out of the prompt and into code that runs before the action, this quarter, starting with the one workflow where a wrong call costs real money.

Thomas Thelliez's architecture for policy-as-code in enterprise AI agents opens with the diagnosis most agent programs need to hear: permissions fail because they are written as intent, not enforced as a runtime decision. A prompt says the agent must not touch sensitive records. A wiki says refunds need approval. Then the runtime gets a user request, retrieved documents, model output and a service account with too much reach.

The model proposes, code decides

The core pattern is a three-way split. The agent planner proposes an action with structured arguments. A policy enforcement point intercepts the request. A policy decision point evaluates it against the actor, the agent, the resource, the data class, the workflow state and the approval state. Model output is a request for authorization, never the authorization itself.

Thelliez is explicit that the engine matters less than the boundary. He cites Open Policy Agent and Cedar as common options, but the mistake he warns about is not picking the wrong policy language. It is letting agent permissions live only in prompts, tool descriptions or static IAM scopes.

He also insists on checks at every boundary, not one at login: agent start, retrieval, context assembly, tool selection, tool execution, memory writes, output release and workflow writes. That list reads long until you realize each item is a place where language turns into access.

Where the checks go in a Salesforce stack

On Salesforce, the natural enforcement point is the action, not the topic instructions. Agentforce actions are Flows and Apex methods, which means you already have a place where code runs before data changes. Put the policy check there.

A practical shape for a FinTech refund agent:

  • The invocable Apex action receives the proposed refund as typed inputs, not free text.
  • It builds a policy envelope: running user, agent identity, amount, account ownership, case state and approval status.
  • It denies, escalates to an approval process, or executes, and it runs database operations in user mode so sharing and field-level security still apply.
  • It writes an audit record with the decision and the reason code.

Profiles, permission sets and sharing rules are your role-based layer. The article's point is that roles alone are too coarse for agents. A support manager may update a case in their region but not bulk export customer records. That is attribute logic, and it belongs in the action's policy check, where amount, region and record ownership are all visible.

Off-platform, the same rule applies to MCP. Treat your tool registry as a control: if a tool has no registry entry and no owner, the broker denies the call. Thelliez lists that exact rule among his deny defaults.

Start with deny rules and one Tier 3 workflow

The article proposes risk tiers from Tier 0 (drafting and public knowledge) to Tier 4 (IAM, payments, legal commitments, production deploys), where Tier 4 is proposal-only by default. Tier 3 covers customer-visible, financial, HR, legal or production-impacting actions and requires approval state, enhanced audit and a rollback path.

His implementation advice is the part to follow literally. Do not start by writing hundreds of rules. Pick one Tier 3 workflow, put a broker between the agent and the target system, write explicit deny rules first, then add allow rules for the smallest useful path. Write abuse-case tests before launch: a user claiming urgency to skip approval, a retrieved document instructing the agent to call an admin tool, an approval that has expired, the same person requesting and approving.

And fail closed. If the policy engine is unavailable, writes, external sends and high-risk reads stop.

Logs that survive the incident review

A log line that says "allowed" will not help you on the worst day. The article's audit schema includes a trace ID, the policy version, a hash of the evaluated input, the human and agent identities, the decision and reason codes. The policy version is the field most teams forget, and without it you cannot replay why something was allowed after the rules change.

If a rule matters enough to write in a prompt, it matters enough to enforce in code and test before release.