AI features playbook
Rules for product features built on language models. Prompts, structured output, retrieval, evals, guardrails, cost, privacy and agents, each with a check.
- Required 22
- Recommended 56
- Optional 2
An AI features playbook for any team that puts a language model inside its product. It covers chat assistants, summaries, search answers, extraction, drafting and agents that act for users. It works with any provider, such as OpenAI, Anthropic, Google or an open model you host yourself.
A model is a part that guesses. It gives different answers to the same question, it changes when the provider updates it, and it costs money on every call. These rules make that part testable, affordable and safe to show to customers.
Start with Deciding to use a model, because the cheapest AI feature is the one you never build. Then read Prompts as code and Evals and quality before the first release.
Related playbooks cover the other sides. The AI-assisted development playbook covers coding agents that write your software. The AI agents and models chapter shows how to attack your own AI features, and this playbook links there for every security rule.
Features that listen to people speaking also need Voice and audio. Features that make pictures or video also need Image and video generation. When outside agents call your product as a tool, read the Agents as users playbook.
Chapters
Deciding to use a model
Use a model only where plain code cannot do the job. Write down what success means, pick the smallest model that meets it and plan for wrong answers.
- Recommended 7
Prompts as code
Keep every prompt in a versioned file and user text apart from instructions. No prompt change ships without review and a passing eval run.
- Required 3
- Recommended 5
Structured output and tools
Ask for JSON that matches a schema, validate it, retry with the error, then fall back. Design tools like a small public API with strict inputs.
- Required 2
- Recommended 4
Retrieval
Answer from your own documents, cite a source for every answer and say so when nothing fits. Search itself, chunks to access rights, is in the search playbook.
- Recommended 2
Evals and quality
Gate releases on a versioned eval set grown from production, with attack and tool choice cases. Grade with code first and watch quality, cost and speed.
- Required 2
- Recommended 13
Guardrails and human review
Check what goes into a model and what comes out. Handle refusals and cut-off answers, let people decide what matters and label AI output.
- Required 3
- Recommended 5
Latency, cost and fallbacks
Stream long answers, time out every call, cache stable prompt parts, price every call, and keep the feature useful when the provider is down.
- Required 4
- Recommended 4
- Optional 2
Logs, privacy and feedback
Log every model call with its versions and cost. Keep prompt text briefly and apart, collect feedback and train only on data people agreed to.
- Required 4
- Recommended 3
Agents in products
Use a fixed workflow when the steps are known. Cap every agent run, ask before acts that cannot be undone, keep a full trace and survive restarts.
- Required 2
- Recommended 8
Voice and audio
Show what the model heard before it acts, delete recordings once transcribed, offer typing beside every voice input, and test speech with many voices.
- Required 1
- Recommended 3
Image and video generation
Check every generated image and video before anyone sees it, refuse likenesses and protected works without rights, and price each job before it starts.
- Required 1
- Recommended 2
Rules from regional law
Most rules here hold for every project. The rules below come from the law of one region. Follow them when your project serves people there.
European Union (EU)
- Required AIF-68 Answer questions about a named person only from records you hold
- Required AIF-60 Say when people talk to an AI
- Required AIF-65 Delete recordings once they are transcribed
This is a lot to check. An Expert can check it for you.
Related playbooks
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/ai-features">Agent Wranglers AI features playbook</a>. In code you write, add a comment next to it with the same link.