All projects
Personal project · 2026

Kingfisher

A Python library for LLM agents that builds a fresh agent for every request, from only the tools, skills and data its caller is allowed to use.

PythonAgentic AILLMAccess Control
Source on GitHubLast updated November 2026

What it does

Give an agent a database, a shell and other agents to hand work to, and the hard question becomes who gets to use which. Most frameworks answer it once, in code, and every user gets the same agent.

Kingfisher answers it per request. Agents, tools, skills and subagents are plain files in a definitions folder, and some carry a lock naming who may reach them. When a request comes in, kingfisher builds the agent from only what that caller can reach. Anything locked away is left out rather than refused, so the model never learns it exists, and two people asking the same agent can get two different agents.

Request
A task, the agent to use, and who is asking: the source ids they hold and their datazone
Definitions folder
  • Agents
    YAML: a prompt, and which tools, skills and subagents it may use
  • Tools
    Python, each saying who may use it
  • Skills
    Written procedures the agent can follow
  • Subagents
    Agents an agent can hand work to
kingfisher
Builds the agent fresh for this request, from only what this caller can reach
Session
  • Conversation
    Turn by turn, rewindable
  • Files
    /outputs, /memory, and /records of every tool result
  • A fenced shell
    Sees this session’s files and nothing else

One agent, four callers

analyst is one of the agents the repository ships. Its file lists three tools, two skills and two subagents, and some of them carry a lock naming who may reach them. Pick a caller to see what gets built:

Caller

analyst

for callers holding sales_db or audit_log
Tools
  • sql_querysales_db
  • csv_profile
  • line_count
Skills
  • tabular-qasales_db
  • code-review
Subagents
  • auditorsales_db | audit_log
  • quarterssales_db + emea
Built-inread_filelsglobgreptask
What the prompt says

You can query the database with sql_query. Name the query behind each figure so somebody can run it again.

This caller works in EMEA, whose fiscal year starts on 1 April. Ask quarters to total figures by quarter.

A locked tool is not in the agent at all, and a locked skill is never mentioned to it. The prompt changes with the caller too.

What the model is told

Once the agent is built, its prompt is put together from what it was granted. kingfisher prompt --agent NAME prints that without calling the model, block by block and named for what wrote each. Grant or take away a capability and watch the prompt follow:

Grant
$ kingfisher prompt --agent analyst
  1. block 1kingfisher
    • The agent’s own prompt

      You answer questions about the data in this workspace. The answer is the deliverable: write a file only when the caller names one.

    • Deployment instructions

      (Your deployment’s standing text for every agent: tone, language, house rules.)

    • The session

      Every file-tool path is virtual and rooted at this session, so these names mean the same thing in every session and on every machine…

    • The file tools

      The file tools take virtual paths rooted at the workspace, so an input file is /inputs/<name>. A host path is not a file-tool path…

    • What your tools returned

      A tool result that ends in a line such as [A-0042] is recorded under that id, which stays the same for the rest of the session…

  2. block 2skills
    • Skills

      Each skill is listed by its name and description alone; what it says to do is in its SKILL.md. The catalogue is yours to read and not to write…

Tools sentread_filelsglobgrepsql_query

The agent speaks first: who it is opens the prompt, and what kingfisher says about how the turn runs comes after. A tool the agent does not hold is never described, since a model told of one calls it.

A turn that waits for you

Each request runs as one turn in a session. An agent can be written to stop before a tool runs and wait for a person; the shipped operator agent stops before every shell command. Pick an answer:

Clear out the scratch files
operator
I’ll remove the three temporary files left in scratch/ by the profiling step.execute: rm scratch/*.tmp
Turn stopped. Waiting on 1 call

The gate is on the whole tool, so ls -la in the shell stops exactly as rm does: there is no command pattern to phrase around. Answering is a new request that presents the caller’s grant again; a pause stores no permissions.

Going back

A session keeps a copy of each version of the files its turns leave, so it can be put back to where any earlier turn ended, all of it or just one half:

Rewind to
Take back

Conversation

  1. 1Profile sales.csv
  2. 2Chart revenue by quarter
  3. 3Report figures in EUR from now on
  4. 4Redo the chart

Files

  • outputs/profile.md
    column profile
  • outputs/revenue.png
    chart in EUR
  • memory/AGENTS.md
    [m1] Reports figures in EUR

The turns after the point you go back to are kept, so a rewind can return to any of them. Only /outputs and /memory are versioned; each turn keeps a copy of what it changed there.

A shell that stays in its session

An agent granted the shell runs its commands inside a fence that sees only its own session. Try a few:

Run a command
execute · session s-21c9
$ ls outputs
profile.md revenue.png

Shown as on macOS, where the fence is sandbox-exec. On Linux it is Landlock or bubblewrap, an allow-list that hands back the one session and nothing outside it.

Also in the box

Every tool result kept

What a turn's tools returned is filed in the session's /records under an id like A-0042, so a long result can be read back later instead of held in the conversation.

Memory

At the end of a turn a memory writer tidies what the session remembers. With a store wired in, a user's memory follows them into new sessions.

Swap the parts

Sessions, run events, instructions and wire formats are plugins: kingfisher ships one of each, and a deployment can bring its own.

Any model endpoint

It runs on deepagents and speaks to Anthropic and OpenAI endpoints out of the box; any other is one registered wire format away.

🎵 My AI-generated music [AI in 2026] is playing. Toggle it on/off in the header.