By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
A revenue team piloted an agent that answers questions about accounts, opportunities and renewals. The agent needed to read the customer relationship management (CRM) system. The fastest path was one service account with tenant-wide read access, held in an environment variable and loaded at container start. The pilot shipped in a week.
Then a rep asked for the accounts she owned. The agent returned 4,000 records, including two regions she was not allowed to see. The model was not wrong. The design answered the question the agent's identity was allowed to ask, not the question the person asked.
This lesson is about posture, not protocol. You will not memorise an authorization flow. You will decide which identity the downstream system sees, where credentials live, and how a low-privilege caller cannot borrow the agent's power.
Authentication asks who is calling. Authorization asks what that identity may do once admitted. Two more questions follow: on whose behalf, and whose name appears in the audit record.
| Posture | What the downstream system sees | Fits when | What it costs |
|---|---|---|---|
| Shared service identity | The platform, through one account | Background work with no personal data and no personal decision | One blast radius for every user; one leaked key is total |
| Per-agent identity | The agent, with its own narrow scopes | Bounded, non-human work such as nightly enrichment | Attribution lands on the agent, not on a person |
| User on-behalf-of identity | The user and their own entitlements | Any action that touches a person's records or speaks in their name | Token exchange, expiry and refresh failures to handle |
The deciding rule is accountability. If a human is named in the record, or would be blamed for the outcome, the downstream system should see that human. If you cannot arrange that, your audit record must name them, and a reviewer must accept the substitute.
Most exposed credentials were placed by someone in a hurry, not by an attacker. Check these six places before you redesign authorization.
The mitigation is the same in every case. The model never holds a credential. The agent asks a tool to act. The tool calls a service that owns the secret and enforces the scope.
Short-lived credentials turn a leak into a short incident. A static key with no rotation turns it into a permanent door. If you fix one thing this quarter, fix the lifetime.
Privilege escalation does not require a tool marked admin. Three patterns do the work quietly, and each has a cheap mitigation.
A posture review that ends in a document proves nothing. Run the test that a penetration tester would run first.
Pick the lowest-privilege real user and the highest-value record set in the system.
Ask the agent, as that user, for the data that user must not see.
Read the downstream log: which identity was presented, which records were returned, and what the system decided.
If the call succeeded, the posture is wrong, no matter what the prompt said.
An agent sends renewal reminders to account owners and reads contract values. Marketing wants a nightly run with no user session. Support wants a rep to trigger it for one account during a live call.
A defensible answer uses a per-agent identity with read-only scopes for the nightly path, and the rep's own identity for the live call. It also names the owner of the nightly reminder, because an agent with no named owner has no accountability when a reminder is wrong.
Key takeaways
Authentication is who is calling; authorization is what that identity may do. Decide both, then decide who owns the outcome.
Match the identity to the unit of accountability: the person named in the record, or a named owner who accepts the substitute.
The model never holds a credential. A service behind the tool owns the secret and the scope.
Escalation hides in grant tools, confused-deputy calls and tool composition, not only in admin tools.
Prove the posture by impersonating the lowest-privilege user and reading the downstream log.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.