Agent access: one email, one press

How an AI agent asks a person for access to SiBear with one email and one press of Approve, what the token it gets can and cannot do, and how the person takes it back. For people and for AI agents.

In plain words

  1. The agent asks for access with your email address and the address of the agent to be tested. It gets a short code, for example K7P-4QM.
  2. SiBear sends you one email with one Approve link. Opening the link changes nothing.
  3. The page shows the same short code. Check it matches the one your agent showed you. Then press Approve. That one press confirms your email, records your authorization to test the agent, and passes the invisible bot check.
  4. The agent, which has been polling, receives a token that starts with sb_agent_. It is shown to the agent once.

The token belongs to your account and to that one agent host. It lasts at most 90 days and is never renewed. The email also holds a revoke link: open it and press the button, and the token stops, before or after you approved.

Rules for agents

  • Ask with the person's email and the agent's address. One request per person is enough; the approval email is the only one sent.
  • Never ask the person to create or paste a token. The token comes only from the poll answer.
  • Never tell the person to press anything but the link in their email.
  • Keep the token in an environment variable or a private file. Never put it in a URL, a prompt, a log or the chat.
  • Never retry a 429 before Retry-After has passed.
  • Never try to do a person-only step (below). Give the person the link instead.

Set up

BASE=https://sibearsecurity.com/v1
UA='sibear-client/1.0 (+https://sibearsecurity.com/docs)'

1. Ask for access

label is optional plain words (60 characters at most). scopes defaults to all four. expires_in_days is 1 to 90 and defaults to 90.

jq -n '{email: "[email protected]", agent_url: "https://agent.example.com", label: "My coding agent"}' |
curl -sS -A "$UA" -H 'Content-Type: application/json' -d @- "$BASE/agent-access/requests"

Response 201: {"code": "K7P-4QM", "poll_token": "...", "expires_at": "...", "poll_interval_s": 5}.

  • Show the person the code and tell them to open the email. Keep poll_token private.
  • The approval link in the email works for 1 hour.

2. Poll

curl -sS -A "$UA" -H 'Content-Type: application/json' \
  -d "{\"token\": \"$POLL_TOKEN\"}" "$BASE/agent-access/requests/poll"

Poll every poll_interval_s seconds (5).

stateMeaningWhat to do
pendingThe person has not approved yet.Keep polling.
approvedApproved. This answer, and only this one, carries `token`, plus expires_at, agent_host and scopes.Save the token at once, privately. If the answer is lost, ask again.
deliveredThe token was already collected.Use the token you saved.
revokedThe person revoked it.Stop. Do not ask again unless the person asks you to.

410 agent_request_gone: the handle is unknown or expired. After approval you have 15 minutes to collect the token.

What the token is bound to

  • The person's account: it sees that person's Reviews and free scans, nothing else.
  • One agent host (agent_host in the poll answer). An agent address on another host is refused with 403 token_host_mismatch, and orders or results of another host answer 404.
  • The scopes it was approved with.

Send it as Authorization: Bearer $SIBEAR_AGENT_TOKEN, never in a URL.

Scopes

ScopeWhat it allows
review:readList the person's orders, read an order, its run status and its report downloads.
review:prepareSet up an order: the agent address, the GitHub link and the context. SiBear answers the security questions and suggests the API format and marker kinds from the person's code.
review:runStart, stop and re-run a Review, and give a fresh test key.
scan:readRead the status and results of free scans of the token's host.

The route behind each scope is in the API reference. A route outside the token's scopes answers 403 token_scope_missing.

Expiry and revocation

  • There is no renewal and no sliding expiry: the date in expires_at is final. After it, ask again; the person approves again.
  • The person revokes from the link in the email: open it, press the button. It works before approval (the request dies) and after (the token stops at once).
  • SiBear stores only a hash of the token, and every use is written to an append-only action log.

What a token can never do

Any token that tries gets 403 person_only. Give the person the link instead.

Person-onlyWhy
Payment, redeeming a code, spending the Review code a set-up link carriesSpending money is the person's decision.
The authorization tick (authorization_accepted)The person's Approve already stands as it. Sending true is refused.
Connecting GitHubAccess to the person's code. The agent may fetch the link with repository-link and hand it over.
The harmful, compute and attacker-notes consents, the memory consentThey are the person's consents.
Confirming markers were placed, and every clean-up confirmationOnly the person can say what was done in their systems.
The bot check, confirming email, signing inThey prove a person is there.
The two presses on the set-up page of a Review a set-up link prepared: authorizing the test and connecting GitHub (POST /v1/account/reviews/{id}/authorize), and starting it (POST /v1/account/reviews/{id}/approve); and opening a used set-up link again (POST /v1/account/reviews/prepared/resolve)They hold the person's authorization, consents and any signature.
Account deletion, emailing a summary, visibility and trust-badge changes, prepared set-ups, everything else under /v1/accountNot part of agent access.

The order view carries needs_person, a list of {item, reason, link, optional}. Hand the person the link of each entry. Items: payment, github, consent:harmful, consent:compute, consent:attacker_context, consent:memory, marker_placement (the last five are optional), cleanup:memory, cleanup:markers (only after a run that sent requests to the agent). A Review needs payment and github before it can start.

Next

  • Set up and run the Review: Run a paid Review.
  • Limits on approval emails and tokens, and every error code: Limits and errors. Over a limit the answer is 429 with Retry-After, and nothing is sent.