Who is acting?
Before the assistant can choose photos, it has to reach your album at photos.example. This lesson compares the three broad ways it can do that: borrowing your credentials, using an identity of its own, and acting as your delegate. They differ in what the photo service can see, what the assistant can do, and what you can take back afterwards.
Borrowing your credentials
The simplest way is for the assistant to become you. You could type your photo service password into the assistant. Or the assistant could operate a web browser in which you are already signed in, clicking through pages the way you would. Some agents work exactly like that.
Either way, the photo service sees you: your password, your sessionThe ongoing connection between later requests and an earlier sign-in, so you are not asked for your password on every click. It is often tracked with a cookie holding an unpredictable session identifier., your browser. Your account there is user-2048, and its activity record looks like this:
14:02:11 user-2048 album.list session=web
14:02:15 user-2048 album.read "Lisbon trip" session=web
14:09:40 user-2048 album.delete "Old screenshots" session=webAll domains, credentials, and tokens in these examples are fictional. Did you delete "Old screenshots", or did the assistant? The photo service cannot tell, and neither can you when you read the record later.
It cannot limit the assistant either. The assistant can do whatever your password or session allows, because there is no separate grant for this task that could be narrower. And stopping it means containing the credential it borrowed. If the service can tell which session the assistant is using, it can end that one; if the exposure is wider, you end your other sessions and change your password. Either way your own use is disrupted, because your authority and the assistant's were never separate.
This is the problem from The problem OAuth solves, where a printing service asked for your photo password. Agents have brought it back.
An identity of its own
The opposite approach gives the assistant its own account at the photo service, the way the printer has its own registration at the print lab in Client credentials. The assistant authenticates as itself, and the photo service knows exactly which software is calling.
That is the right model for the assistant's own resources, such as storage it keeps for its own use. It is the wrong model for your album. The photo service could share specific albums with the assistant's account, the way you share one with a friend, but then the assistant's account reaches every album anyone shared with it, and the photo service has only the assistant's word for which customer asked for each task. In the risky version, the account is given broad access to customers' photos to make that easy. A bug, or one injected instruction, could then reach every customer the assistant serves.
Acting as your delegate
The third way combines the two. The assistant keeps its own identity, and you give it limited authority over your data. The photo service sees both parties: the assistant, acting for you, with exactly the access you approved.
14:02:15 user-2048 album.read "Lisbon trip" via assistant.example
14:09:40 user-2048 album.delete "Old screenshots" session=webNow the record shows that the assistant read the Lisbon album and that you deleted the screenshots yourself. The photo service can apply its own rules to the assistant, such as refusing deletions from any agent. And you can take back the assistant's access without touching your password or any other app.
| How the assistant reaches your album | What the photo service sees | What the assistant can do | How you stop it |
|---|---|---|---|
| Your credentials or session | You | Whatever your password or session allows, with no separate grant to narrow it | End the session it uses, or your other sessions and password if the exposure is wider |
| Its own identity | The assistant | Only what was shared or granted to its own account | The operator controls the account; you can unshare what you shared with it, where the service allows |
| Your delegate | The assistant, acting for you | Only what you approved | Take back its access on its own |
Read the last row against the first. Both let the assistant act on your album, but only delegationLetting an application do a limited task with someone else's authority, such as a printing service reading your photos, without giving it your password. OAuth 2.0 is the usual framework for arranging it. leaves the photo service a record that names the assistant and a grant you can end without ending anything of your own. Delegation is the idea OAuthA framework that lets a person give an application limited access to their resources at another service, using tokens instead of sharing their password. OAuth is about access; OpenID Connect adds sign-in. was built on, which is why the assistant's access in the following lessons is an OAuth grant.
What an agent's identity includes
"The assistant" can mean several different things, and a good record keeps them apart:
- The agent product. The assistant offered by
assistant.example, registered at the photo service as a client with its own client ID. - The running software. The copies of the assistant running on the operator's infrastructure right now. Each is a workload with its own identity and short-lived credentials, as in Credentials for workloads.
- The operator. The company that runs
assistant.example, responsible for its behavior and for protecting its credentials. - The person it serves. You, for this task.
A tokenA piece of data issued by a trusted service that a client presents as a credential, for example to call an API or to report a sign-in. Some tokens carry readable claims; others are random strings that only the issuer can interpret. or record entry should not blur these together. The client ID says which product is calling. The subject says whose authority it is using. The operator answers for the product.
The model the assistant uses, and its version, is a different kind of fact. It may change every few weeks without the assistant becoming a different party. It can be a useful detail in a record, but it is not the assistant's identity, and permissions should not have to be granted again each time the model is updated.
A directory can list agents separately from people and ordinary workloads, each with an owner and a way to disable it, which gives an organization an inventory of its agents. The entry still has to be tied to the credentials a service actually checks, or disabling it in the directory changes nothing the agent presents.
Telling agents and people apart
A service has good reasons to know when a request comes from an agent. It may set different limits for agents, such as fewer requests per minute or no deletions. It may want to show you which actions an agent took for you. And when something goes wrong, it needs to know who did what.
Delegation shows the service which client is acting. To apply an agent rule, the service also needs a trustworthy way to know that this client is an agent, such as a classification it recorded when the client registered; a client name alone does not prove it. When an agent borrows your session, the service can only guess from behavior. A request header announcing "I am an assistant" is a claim like any other: anyone can send it, and an agent that wants to pass as you can leave it out.
New protocolAn agreed set of rules for the messages two systems exchange and what each message means. HTTP, OAuth 2.0, OpenID Connect and SAML are all protocols. work is adding ways to describe and authorize agents, such as IETF drafts on client identifiers and on carrying identity across domains, and the agent cards that agent-to-agent protocols use to describe what an agent is. These are Internet-Drafts and vendor specifications, not settled standards, so check each one's status and trust model before relying on it. The foundation this lesson builds outlasts any of them: an agent with its own identity, acting with authority a person delegated to it.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Compare the fixed agent acting as itself and as a person's delegateSee a service refuse the agent's own token where a person is required, then follow a delegated read that names both the agent and the person.