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.
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.
- AgentsYAML: a prompt, and which tools, skills and subagents it may use
- ToolsPython, each saying who may use it
- SkillsWritten procedures the agent can follow
- SubagentsAgents an agent can hand work to
- ConversationTurn by turn, rewindable
- Files/outputs, /memory, and /records of every tool result
- A fenced shellSees 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:
analyst
for callers holding sales_db or audit_log- sql_querysales_db
- csv_profile
- line_count
- tabular-qasales_db
- code-review
- auditorsales_db | audit_log
- quarterssales_db + emea
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:
- block 1kingfisher
- block 2skills
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:
execute: rm scratch/*.tmpThe 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:
Conversation
- 1Profile sales.csv
- 2Chart revenue by quarter
- 3Report figures in EUR from now on
- 4Redo the chart
Files
- outputs/profile.mdcolumn profile
- outputs/revenue.pngchart 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:
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.