SwiftRelay

← All sprint notes

First AI Feature: A Checklist Before the Green Light

First lapsEN

Your first AI feature should solve one narrow problem, survive predictable failures, and give users a clear way to recover. Treat the launch as a sprint with exit criteria, not a model demo. This checklist takes a concrete example, turning support notes into a draft reply, from initial scope to a controlled release.

1. Define the task and its shipping boundary

Write a one-sentence contract: given support notes, produce an editable reply using only the supplied facts. Explicitly exclude sending messages, issuing refunds, and changing account settings. A smaller permission boundary makes the first release easier to test and safer to operate.

  • Input: Agent-selected notes and the relevant policy excerpt.
  • Output: A reply draft with unresolved questions clearly marked.
  • Success: The agent can use the draft without correcting invented facts.

2. Build an evaluation set before polishing prompts

Collect representative examples, including incomplete notes, conflicting policies, angry customers, and requests outside your support scope. Remove personal information unless you have an approved reason to retain it. For each example, record required facts, forbidden claims, and the appropriate refusal or clarification behavior.

Include adversarial content such as a customer message telling the model to ignore policy. Your evaluation should reveal whether the feature follows your application rules rather than instructions embedded in user-provided material.

3. Connect a model through your backend

Keep credentials on your server, never in browser code or a mobile bundle. SwiftRelay is a practical option for accessing multiple model providers through a pay-as-you-go relay. Sign up for SwiftRelay to use the small gift credit on your initial integration and evaluation runs.

For an OpenAI-compatible SDK, configure the base URL as https://api.fastapirelay.com/v1 and supply your relay key through a server-side secret. Claude Code and Gemini CLI use the bare host, https://api.fastapirelay.com. Start with one candidate, such as Claude Sonnet 5.5, and validate its behavior against your evaluation set before adding routing complexity.

4. Make the output contract enforceable

Separate application instructions from customer text. Tell the model which facts it may use, what it must not infer, and when to ask for clarification. Request a predictable structure, such as a draft field and a list of missing information.

Validate the response on your backend. Reject malformed output, unexpected fields, and oversized responses. Structured output can simplify parsing where supported, but it does not prove that a statement is true. Check important claims against the supplied source material.

5. Add failure paths before the happy-path polish

Handle provider errors, empty responses, invalid output, and interrupted requests explicitly. Preserve the user's notes and offer manual editing when generation fails. Use bounded retries for transient failures; do not retry invalid requests indefinitely.

Treat generated text as untrusted content when displaying it. Keep the initial feature read-only and require human approval before any external action. A friendly fallback is useful; silently replacing a failed draft with unsupported claims is not.

6. Put token spending behind application limits

Set input-size limits, output-token caps, per-user quotas, and an application spending ceiling. SwiftRelay bills per token, so estimate the cost of a typical request using current model pricing, then include retries and unusually long inputs in your budget.

Record token usage and estimated cost by feature. Add a server-side switch that disables generation when your budget is exhausted while leaving the manual workflow available.

7. Review privacy and operational visibility

Confirm provider data-handling terms and your own retention requirements before sending real customer data. Minimize what leaves your system, redact secrets, and avoid storing raw prompts in routine logs. Record request identifiers, model names, prompt versions, validation failures, and usage instead.

Restrict access to any sampled content used for quality review. Give users an accurate explanation of what the feature sends and generates.

8. Release behind a flag and inspect real failures

Start with internal users, then a limited customer group. Review draft acceptance, factual corrections, failed requests, and cost per accepted draft. Keep the model and prompt versions identifiable so regressions can be traced.

Expand access only after the feature meets your written acceptance criteria. Keep a rollback switch, rerun the evaluation set after changes, and prioritize recurring failure patterns over adding more AI capabilities.

Keep reading

Back for another lap?Log in