Agent Experiences

Principles for agent-accessible services

Six rules that hold whichever protocol you end up building on.

In short

A service works for agents when a program acting for someone can find out what it’s allowed to do, do it safely, and be held to account for it afterwards. Six principles get you there. Every action should trace back to a person who authorized it. Agents shouldn’t have to guess what your service can do, so list it. Give each task only the permissions it needs, make retries safe, write failures a machine can act on, and make sure you can pick agent traffic out of your logs. Treat these as design rules from the start, because adding any of them later is much harder than building with them.

These principles build on the idea of agents as a medium: the caller is acting for a person, so it’s neither an intruder nor a fully trusted partner. Each principle below is stated first, then made concrete.

1. Human accountability

Every action an agent takes in your service must trace back to a specific person who authorized it. Letting an agent choose the steps doesn’t make anyone less responsible for them. If you can’t answer “on whose authority did this happen?” for every change in your system, you already have a record-keeping gap, and agents will make it much worse.

  • Carry the authorizing user through every layer of your system, along with the agent’s own identity. A token (the credential an agent presents) that says “this is Acme Assistant” without saying “acting for user 4471” isn’t enough to piece anything together later.
  • Record the software that acted alongside the person it acted for, so your audit log can answer both “who authorized this?” and “what performed it?”
  • Show that record to the user as well as to your compliance team. Someone who handed off a task needs to see what was done in their name, written as a history of actions rather than a stream of raw requests to your API (application programming interface, the way software talks to your service).
  • Make authority expire. Permission granted for one task shouldn’t quietly stay in place forever.

2. Capability discovery, so agents don’t have to guess

An agent should be able to learn what your service can do by asking it, at the moment it needs to know. A human developer reads your docs once and builds what they learned into their software. An agent has no such step. Whatever it can’t discover on the spot, it fills in from what it knows about similar APIs, and filling in is where broken requests come from.

  • Publish a description that software can read, listing each action, its inputs, its limits, and what has to be true first. That can be a tool list, an OpenAPI document (a standard file describing everything an interface can do), or both.
  • Generate it from your actual code. A description someone updates by hand drifts out of date, and a confidently wrong description is worse than none.
  • Describe what the service can do as outcomes a user would recognize (“cancel a subscription at period end”) rather than your internal names for things. The agent is trying to match what a person asked for.
  • Where you can, show the caller’s actual permissions, so an agent only plans with actions it can complete.
  • Serve documentation in a form a fetching program can read, such as plain markdown or clean HTML built on the server. Docs that need JavaScript to show their content might as well not be published, as far as an agent is concerned.

3. Least privilege and scoped permissions

Grant the narrowest permission that lets the task succeed, limited in what it covers, which items it touches, and how long it lasts. That’s what least privilege means. It’s old security advice that matters more now, because an agent with too broad a permission can use all of it in seconds. Agents also read untrusted material (web pages, emails, documents) that may contain instructions written to make them do exactly that.

  • Define scopes (the named permissions a user grants) around real tasks, such as “read invoices” or “create a draft order,” rather than around how your data is organized. If nobody could explain a scope on the “allow this app” screen, it’s too broad.
  • Separate reading from changing, and separate changes you can undo from ones you can’t. Spending money, deleting data, and changing security settings deserve their own scopes and their own confirmation step.
  • Limit grants by time and by what they cover. “This assistant, these projects, thirty days” is a far better default than a permanent token for the whole organization.
  • Give users one place to see and cancel every permission they’ve handed out, and make canceling take effect straight away rather than when the token next expires.
  • Apply limits to each grant as well as to each account, so one misbehaving agent can’t use up a team’s whole allowance of requests.

4. Idempotency and safe retries

Assume every request will be sent more than once. Retrying is how an agent normally recovers, and it retries exactly when it can’t tell whether the first attempt worked. If the requests that change data aren’t idempotent (safe to receive twice), that uncertainty turns into duplicate charges and duplicate orders, and the customer sees it as your failure.

  • Accept an idempotency key (a unique ID the caller attaches, so a request sent twice only takes effect once) on every request that changes something. When the same key comes back, return the stored result instead of acting again.
  • Say which actions are safe to retry in the description of what your service can do, so an agent doesn’t have to guess.
  • Offer a way to check before acting again. A lookup by the caller’s own reference number beats a blind retry.
  • Where an action can’t be all or nothing, offer the undo step as a real action an agent can take, rather than a support ticket.

5. Errors a machine can understand

A failure response should tell a machine what went wrong, what to change, and whether trying again could ever help. A friendly apology is a dead end for a caller that can’t ask a follow-up question. Clear errors decide whether an agent adapts or keeps hammering at an endpoint (one address in your API) that will never accept its request.

  • Use accurate status codes and the same structured error format everywhere in your service.
  • Include a fixed error code software can read, the specific field or item at fault, and a clear signal about whether to retry.
  • Say when to retry rather than leaving the agent to guess. A specific wait time prevents both a flood of retries and needless giving up.
  • Treat error codes as part of your public API. Agents make decisions based on them, so quietly changing what one means breaks integrations you can’t see.
  • Handle refusals the same way. If a policy blocks the request, say so in a way the agent can pass on to its user, so they know to take over instead of deciding you’re broken. The delegation cycle page has a worked example of a good error next to a bad one.

6. Seeing agent traffic in your logs

You should be able to tell agent traffic from human traffic in your own logs, and know which agent it is. Every big decision this site discusses, such as what to open up, what to restrict, and what to charge for, depends on measurements you probably don’t have yet. Most analytics tools were built to filter out automation, so agent traffic is thrown away before you see it.

  • Sort traffic by purpose as well as by name. Collecting pages for AI training, building a search index, and fetching a page because a user asked are different relationships, even when they come from the same company.
  • Check identity where you can (signed requests, published address lists, and reverse DNS lookups, which check that an address really belongs to the company it claims) and record whether the check passed, rather than just the name the bot claimed.
  • On signed-in requests, log the agent that acted alongside the user who authorized it, and keep that link easy to search.
  • Track results as well as volume. The useful measure is which agent attempts succeed and where the failures bunch up, because that list is your to-do list.
  • Accept a limit you can’t get around. AI browsers identify themselves as ordinary browsers, so some delegated traffic will never be identifiable. Measure what you can, and don’t build policy that assumes you can see everything.

Authentication for agents, and where it really stands

Letting an agent act with a user’s authority is the least settled part of all this.

The habit to design out

A user handing their password to an agent. The password covers everything, nobody can tell who used it, it can’t be taken back without a reset, and it gets around multi-factor authentication (the extra code or prompt at sign-in). Worse, it’s what people do when nothing better exists. Not offering a proper way to hand off access isn’t neutral, because it pushes people toward the worst option. The same goes for long-lived personal access tokens (keys a service lets you create for your own scripts) pasted into an agent’s settings, which are convenient, far too broad, and in effect permanent.

What works today. OAuth (the standard behind most “allow this app to access your account” screens), in its 2.1 version, is still the practical foundation. The user signs in with you directly, agrees to a specific scope, and the agent receives a token that is narrow, expires, and can be canceled. Make the “allow this app” screen say in plain words what the agent will be able to do, keep scopes shaped around tasks, prefer short-lived access tokens that get refreshed, and show users a list of their connected agents. Dynamic client registration, which lets an app sign itself up with your service automatically, matters more here than in ordinary integrations, because agents connect to services nobody registered them with in advance.

What’s still missing. OAuth can say that an app may act for a user. It has no built-in way to express a chain (this person authorized this assistant, which called this helper agent, which reached your service), or limits on a single action like “up to $200, once, today.” Work on standards for delegated authority and agent identity was active through 2026 at the IETF (the body that sets internet standards) and industry identity groups, but nothing has settled as the answer yet, and implementations vary. Treat any vendor’s own agent-identity features as useful today and unlikely to be the final shape.

What to do in the meantime. Build the limits you need into your own permission system rather than waiting for a standard to carry them. That means scopes, spending caps, and rate limits attached to each grant, an extra confirmation step for actions with consequences, and an audit trail that records both the person and the software. Checking which agent is calling, with Web Bot Auth and published address lists, is covered on the implementation page.

Further reading from Field Notes

Posts with more on this topic, each with its date.

All Field Notes

Stay Updated

A monthly email about AI search, AI crawler policy (the rules for the AI bots that visit websites), and new standards for agents. It includes every Field Note published that month, and you can unsubscribe at any time.

We store your email address only to send you this newsletter. See our privacy policy.