In plain words
- 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. - SiBear sends you one email with one Approve link. Opening the link changes nothing.
- 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.
- 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
429beforeRetry-Afterhas 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
codeand tell them to open the email. Keeppoll_tokenprivate. - 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).
state | Meaning | What to do |
|---|---|---|
pending | The person has not approved yet. | Keep polling. |
approved | Approved. 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. |
delivered | The token was already collected. | Use the token you saved. |
revoked | The 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_hostin the poll answer). An agent address on another host is refused with403 token_host_mismatch, and orders or results of another host answer404. - The scopes it was approved with.
Send it as Authorization: Bearer $SIBEAR_AGENT_TOKEN, never in a URL.
Scopes
| Scope | What it allows |
|---|---|
review:read | List the person's orders, read an order, its run status and its report downloads. |
review:prepare | Set 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:run | Start, stop and re-run a Review, and give a fresh test key. |
scan:read | Read 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_atis 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-only | Why |
|---|---|
| Payment, redeeming a code, spending the Review code a set-up link carries | Spending money is the person's decision. |
The authorization tick (authorization_accepted) | The person's Approve already stands as it. Sending true is refused. |
| Connecting GitHub | Access 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 consent | They are the person's consents. |
| Confirming markers were placed, and every clean-up confirmation | Only the person can say what was done in their systems. |
| The bot check, confirming email, signing in | They 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/account | Not 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
429withRetry-After, and nothing is sent.