Skip to content

librarian v0.21.0

Choose a tag to compare

@github-actions github-actions released this 17 Nov 01:46
· 27 commits to main since this release

Several writes as one plan

  • One decision for a change that takes several requests. A commit through GitHub's API is a blob, a tree, a commit and a branch, and then a pull request. Asked for one at a time, each needed its own approval and the approver saw each without the others. A plan (plan over A2A, write_plan over MCP) puts them in front of the approver together, each request shown where it will go and with its body, and is approved once. The writes are then made in order.
  • A later step can use what an earlier one returned: {"sha": {"$from": "blob.sha"}}, in an argument or anywhere in a body. The approval page marks what is not known yet.
  • Checked twice. Every step passes the policy check of a write before anyone is asked, and again just before it is sent, with the values now filled in and against the registry as it is then. An argument an agent's limits restrict, and anything a DELETE is sent, has to be written in the plan itself.
  • It stops where it fails, and says so. The first step that fails or cannot be checked ends the plan; nothing is undone. The outcome names the step and what was made before it, and every step has a state: made, failed, not sent, or unknown when a request went out and no answer came back.
  • A plan is on one API, holds only writes and at most 20 of them, never runs under a grant or automatic approval, and counts against the write rate limit as as many writes as it has steps (so writes.rate_limit_per_minute, 10 by default, is also the longest plan an agent can ask for). More.

Limits inside an API

  • apis and write_apis say which APIs an agent may use. limits, on a caller or on an Agent Substrate rule, says what it may do inside one: which operations, and which values their arguments may take (owner: [acme], repo: ["payments-*"]).
  • An operation that takes none of the limited arguments cannot be held to anything, so it is refused unless allow_without names it; a limited argument the API treats as optional must be given.
  • Decided by the policy engine for reads, writes and the planner's calls. A call outside the limits is refused, not put to an approver, and no grant reaches past them. capabilities shows an agent only what it can reach. Only arguments are looked at, not what a request body names. More.

Credentials made for each call

Three kinds of authentication where nothing long-lived goes to the API, and often nothing is stored at all:

  • OAuth 2.0 client credentials: the API gets a token that expires by itself; the client secret goes to the token endpoint only.
  • A GitHub App instead of a personal token: a token for each call, valid for an hour, limited to the repository the call names, and read-only when the call is a read.
  • AWS Signature Version 4: every request is signed, as librarian's own identity or as a role assumed for that API for 15 minutes. There is no key to store.

They can be used on approved entries only. An API's authentication can now be described in full on its page in the console, and a credential that was made and then refused is reported as that, not as a missing key. More.

Whatever an API does

  • The agent is told what happened. When an API cannot be reached or does not finish answering, the agent is told so in those words, with the reason when there is one (the name did not resolve, the connection was refused, its certificate was not accepted, it did not answer in time), instead of "internal error". For a write it is also told whether the request can have reached the API: "was not sent" or "may have reached it".
  • One request has a time limit as a whole (twice request_timeout_seconds), however slowly an answer trickles in.
  • An answer is passed on as data only if everything after librarian can handle it: JSON nested deeper than 100 levels arrives as text, NaN and Infinity as null.
  • A write always ends. An approval can no longer stay "executing" after a failure or a stopped replica: it is closed with what is known (after 15 minutes, or ten times the request timeout if that is longer) and never sent again by librarian. A repeat with the same idempotency key is refused while the first is still open.
  • librarian doctor looks through the database and the audit file for credentials that versions before 0.20 could have stored there and names them by their reference; --redact replaces the copies in the database.
  • The audit record of a write names the approval it was made under, and for a plan the step.
  • These are tested as a whole: a fake API with every misbehaviour we know of (40 of them) runs through the service, A2A and MCP, as a read, as a write and as the middle step of a plan.

Upgrade

  • No configuration changes are needed. limits and the new kinds of authentication are there when you use them.
  • Finish the rollout before using what is new. A replica still on 0.20 cannot read an entry that uses one of the new kinds of authentication, and does not know plans.
  • If you ran a version before 0.20, run librarian doctor once: it finds any credential those versions stored outside the secret store. Replace the credentials it names at the API, then run it with --redact.
  • If a gateway in front of librarian lists the tools agents may call, add write_plan there for the agents that should have it.
  • What an agent is told when an API does not answer has changed from "Internal error in the librarian" to a sentence naming the API and the reason; a task still ends as failed.