Keep access within the correct tenant and task.
A tenant is a customer or organization using a shared service. An application programming interface (API) must check the user’s tenant, the resource’s tenant, and the permissions delegated to any acting service or agent.
Why this lesson?
An agent helps a user from tenant A read an order. The agent has wider service access, but it must not use that access to read another tenant’s order.
Learning goal and prerequisites
Request the order
The application treats the requested web address as input that the caller can change. It validates the credential, identifies the user and agent, and loads the actual tenant information for the order from trusted data.
Inspect request, response, and claims
Try a failure scenario
↳ Change a condition
Read the detailed explanation
Why it exists, how it works, and where it fits
Multi-tenant systems and delegated workflows create two kinds of risk at once. A request may cross from one customer’s data into another customer’s data, and a service or agent may have more authority than the user task actually needs. Tenant and delegation boundaries keep those powers separated.
A tenant boundary makes sure that a user or service operating for tenant A cannot reach tenant B’s resources simply by changing an identifier in the request. The application should load the resource’s real tenant from trusted data and compare it with the verified identity and token context.
A delegation boundary limits the authority passed to another service or agent. The downstream component should receive only the actions, resources, recipients, and time period needed for its part of the task. Broad service privileges should not silently replace the user’s narrower grant.
These checks are useful because a valid credential can still be dangerous at the wrong boundary. The system should validate user authority, service authority, tenant membership, and the actual resource together. Audit records should also preserve who acted, for whom, and under which delegated permission.
Investigation
Inspect the traffic, select a diagnosis in the checkpoint, then reveal the repair.
Check your understanding
Pass the lesson quiz
Answer every question correctly to unlock the next lesson. Retry as often as you need.