Authorize AI Tool Calls on the Server
The user writes the prompt and the model picks the arguments, so every id in a tool call is attacker-controlled. Check each call against a context the server built.
AI
Building features on language models, and working with coding agents without losing control
12 guides in this collection
The user writes the prompt and the model picks the arguments, so every id in a tool call is attacker-controlled. Check each call against a context the server built.
Every button, shortcut and AI move goes through the same typed dispatch function. The AI can then do exactly what a person could do, and nothing else.
A language model does not know the time or anyone's time zone. Give it both on every turn, store real zone names, and refuse to schedule without them.
The provider key stays on the server. Chat streams through your own endpoint with an allow-list of models, and voice gets a short-lived token made for one session.
A small local model is cheap and private, and it loses count and copies its input. Gate when it runs, keep batches small, and check its output in code.
Everything in an always-loaded instruction file is paid for on every turn of every session. Keep rules and pointers there, and move subsystem detail to docs read on demand.
A rules file for coding agents earns its place one verified failure at a time. Each rule names what went wrong, and anything an agent would get right anyway is left out.
Name the model tier for each automated job in one registry file, with the reason and the date you last judged it. Scripts read the registry and never hard-code a model.
A coding agent commits each finished unit of work locally, with specific paths, and never pushes. A session-end hook catches whatever was left uncommitted.
An agent that read a web page or a chat message and then saved a note may have saved someone else's instruction. Stamp such notes, and never act on one without asking.
One setting decides how much an agent system may do by itself. Every time it stops, it records why, what happens next, and who owns the next move.
Serve robots.txt, a sitemap and Markdown versions of your pages for AI agents, and advertise only what really exists. A test fails when a public page is missing.