Kaizen Teams

Dropdown

Table of Contents

Time to read

·

12

Published on

·

June 3, 2025

Last updated on

·

April 10, 2026

Valentina Ibinete, Marketing Lead at Kaizen Softworks

Valentina Ibinete

Travel magnet collector

Marketing Lead

How to Give Windsurf the Right Context for Smarter AI Coding

Published on

·

April 10, 2026

Last updated on

·

April 10, 2026

Time to read

·

12

Valentina Ibinete, Marketing Lead at Kaizen Softworks

Valentina Ibinete

Marketing Lead

Windsurf is an AI coding assistant that generates code based on the context you provide. If you don’t give it enough context, it behaves like a new teammate with no prior knowledge. This matters because better context directly improves code accuracy, consistency, and usefulness. This guide is for developers who want more reliable results from AI-assisted coding.

Key Takeaways

  • Windsurf does not retain full context by default, so you must provide it explicitly.
  • Rules, Memories, @mentions, and Impersonation are the 4 core ways to guide its behavior.
  • Clear and structured context produces better code than long, vague instructions.

What is Windsurf in AI coding?

Windsurf is an AI-powered coding assistant that generates and modifies code based on user prompts and contextual inputs. It relies on the information you provide in each interaction to produce results.

This behavior is aligned with how large language models (LLMs) work: they generate outputs based only on the input context they receive, not long-term memory (OpenAI Prompt Engineering Guide).

Bottom line: Windsurf performs best when you explicitly define what it should know before generating code.

Why does Windsurf need context to generate better code?

Windsurf needs context because it cannot reliably infer your project structure, goals, or constraints on its own.

Without context:

  • It may generate incorrect or irrelevant code
  • It can modify unintended files
  • It may ignore project-specific conventions

Research on generative AI systems shows that models perform better when given explicit instructions and relevant examples (Google Cloud Prompt Design Guide).

With proper context:

  • Code aligns with your architecture
  • Outputs are more predictable
  • You reduce rework and corrections

Conclusion: Context acts as the “memory layer” that makes AI outputs usable in real projects.

How to use Rules in Windsurf?

Rules are predefined instructions that control how Windsurf behaves across conversations or projects. They act as guardrails that reduce randomness and enforce consistency.

Providing structured instructions is a core prompt engineering technique, where clear constraints help guide model outputs toward desired formats and behaviors (OpenAI Prompt Engineering Guide).

Types of Rules

Type Scope Example
Global Rules All projects “Write code in English, respond in Spanish.”
Project Rules Single project “Always read the README before answering.”

How to use Rules effectively (step-by-step)

  1. Define behavior clearly
    Example: “Use TypeScript for all code.”
  2. Set language and formatting preferences
    Example: “All comments must be in English.”
  3. Add project-specific instructions
    Example: “Follow the structure defined in README.md.”
  4. Keep rules minimal
    Too many rules reduce clarity and can confuse the model.

Pro tip (based on practice): In our tests, 3–5 highly specific rules outperform long rule lists, because the model prioritizes clearer signals.

Bottom line: Use fewer, clearer rules to guide consistent outputs.

What are Windsurf Memories and When Should You Use Them?

Memories are stored pieces of context that Windsurf uses to remember important project information over time.

They function similarly to persistent notes about your project.

How Memories work

  • Windsurf can auto-generate memories based on conversations
  • You can also manually create memories
  • They are project-specific (not global)
  • You can edit them anytime

Example of a Memory

“This app is a SaaS dashboard for managing subscriptions.”

When to use Memories

Use Memories when:

  • You are working on long-term projects
  • You want to avoid repeating the same explanations
  • Your project has stable requirements
  • You need consistent context across sessions

Avoid overusing Memories when:

  • You want exploratory or creative outputs
  • Your project changes frequently

Important limitation: Memories can become outdated if your project evolves, so you must review and update them regularly.

Conclusion: Memories reduce repetition but require maintenance to stay accurate.

How to Use @mentions in Windsurf to Provide Context?

@mentions allow you to reference specific files, code, or documentation directly in your prompt.

This reflects a key prompt engineering principle: providing grounded context (real data or documents) reduces hallucinations and improves accuracy (OpenAI Prompt Engineering Guide).

Examples of @mentions

  • @README → Loads project overview
  • @server.js → References backend logic
  • @/components/Button.tsx → Targets a specific UI file

How to use @mentions (step-by-step)

  1. Reference the exact file or resource
  2. Give a clear instruction
    Example: “Read @README and summarize the architecture.”
  3. Limit scope
    Prevents Windsurf from modifying unrelated files

Why this works:
You eliminate guesswork by forcing the model to use real project data instead of assumptions.

Bottom line: @mentions are the fastest way to inject precise, relevant context.

What is "Impersonation" in Windsurf and How Does it Work?

Impersonation is a technique where Windsurf adopts a specific role or persona to guide its outputs.

This is similar to role-based prompting, a widely used technique where assigning a role improves output relevance and tone (OpenAI Prompt Engineering Guide).

This is useful for tasks that require a particular perspective, such as design, QA, or architecture.

Example of impersonation

“Impersonate a senior UX designer focused on usability.”

Advanced use: Persona files

You can create reusable profiles (e.g., @luna.md) that define:

  • Tone
  • Priorities
  • Constraints

Then use: “Impersonate @luna”

Use cases for Impersonation

  • UX/UI design perspectives
  • Code review roles
  • Architecture decision-making
  • Testing and QA validation

Why it works

Impersonation narrows the model’s decision space by:

  • Defining priorities (e.g., usability vs performance)
  • Applying consistent criteria across outputs

Real-world workflow tip: In practice, teams use impersonation to:

  • Generate quick prototypes (HTML/CSS)
  • Validate ideas before implementation
  • Run AI-powered code reviews after development

Conclusion: Impersonation adds focus and expertise to AI outputs.

Rules vs Memories vs @mentions vs Impersonation

Feature Purpose Scope Best Use Case
Rules Define behavior Global / Project Consistency
Memories Store context Project Long-term projects
@mentions Inject data Instant Precision
Impersonation Change perspective Task-based Specialized outputs

How to give Windsurf the best context (Checklist)

Use this checklist before prompting:

  • ✅ Define clear rules
  • ✅ Add key memories
  • ✅ Reference files with @mentions
  • ✅ Use impersonation for complex tasks
  • ✅ Keep instructions short and specific

Common mistakes when using Windsurf

  • ❌ Giving too many rules at once
  • ❌ Not updating memories after changes
  • ❌ Writing vague prompts
  • ❌ Not referencing actual files
  • ❌ Expecting Windsurf to “just know” your project

Fix: Always provide explicit, structured context.

Final Summary

To get better results from Windsurf, you need to control its context.
Use rules for consistency, memories for persistence, @mentions for precision, and impersonation for focus.

The clearer your context, the better your code.

Windsurf is an AI coding assistant that generates code based on the context you provide. If you don’t give it enough context, it behaves like a new teammate with no prior knowledge. This matters because better context directly improves code accuracy, consistency, and usefulness. This guide is for developers who want more reliable results from AI-assisted coding.

Key Takeaways

  • Windsurf does not retain full context by default, so you must provide it explicitly.
  • Rules, Memories, @mentions, and Impersonation are the 4 core ways to guide its behavior.
  • Clear and structured context produces better code than long, vague instructions.

What is Windsurf in AI coding?

Windsurf is an AI-powered coding assistant that generates and modifies code based on user prompts and contextual inputs. It relies on the information you provide in each interaction to produce results.

This behavior is aligned with how large language models (LLMs) work: they generate outputs based only on the input context they receive, not long-term memory (OpenAI Prompt Engineering Guide).

Bottom line: Windsurf performs best when you explicitly define what it should know before generating code.

Why does Windsurf need context to generate better code?

Windsurf needs context because it cannot reliably infer your project structure, goals, or constraints on its own.

Without context:

  • It may generate incorrect or irrelevant code
  • It can modify unintended files
  • It may ignore project-specific conventions

Research on generative AI systems shows that models perform better when given explicit instructions and relevant examples (Google Cloud Prompt Design Guide).

With proper context:

  • Code aligns with your architecture
  • Outputs are more predictable
  • You reduce rework and corrections

Conclusion: Context acts as the “memory layer” that makes AI outputs usable in real projects.

How to use Rules in Windsurf?

Rules are predefined instructions that control how Windsurf behaves across conversations or projects. They act as guardrails that reduce randomness and enforce consistency.

Providing structured instructions is a core prompt engineering technique, where clear constraints help guide model outputs toward desired formats and behaviors (OpenAI Prompt Engineering Guide).

Types of Rules

Type Scope Example
Global Rules All projects “Write code in English, respond in Spanish.”
Project Rules Single project “Always read the README before answering.”

How to use Rules effectively (step-by-step)

  1. Define behavior clearly
    Example: “Use TypeScript for all code.”
  2. Set language and formatting preferences
    Example: “All comments must be in English.”
  3. Add project-specific instructions
    Example: “Follow the structure defined in README.md.”
  4. Keep rules minimal
    Too many rules reduce clarity and can confuse the model.

Pro tip (based on practice): In our tests, 3–5 highly specific rules outperform long rule lists, because the model prioritizes clearer signals.

Bottom line: Use fewer, clearer rules to guide consistent outputs.

What are Windsurf Memories and When Should You Use Them?

Memories are stored pieces of context that Windsurf uses to remember important project information over time.

They function similarly to persistent notes about your project.

How Memories work

  • Windsurf can auto-generate memories based on conversations
  • You can also manually create memories
  • They are project-specific (not global)
  • You can edit them anytime

Example of a Memory

“This app is a SaaS dashboard for managing subscriptions.”

When to use Memories

Use Memories when:

  • You are working on long-term projects
  • You want to avoid repeating the same explanations
  • Your project has stable requirements
  • You need consistent context across sessions

Avoid overusing Memories when:

  • You want exploratory or creative outputs
  • Your project changes frequently

Important limitation: Memories can become outdated if your project evolves, so you must review and update them regularly.

Conclusion: Memories reduce repetition but require maintenance to stay accurate.

How to Use @mentions in Windsurf to Provide Context?

@mentions allow you to reference specific files, code, or documentation directly in your prompt.

This reflects a key prompt engineering principle: providing grounded context (real data or documents) reduces hallucinations and improves accuracy (OpenAI Prompt Engineering Guide).

Examples of @mentions

  • @README → Loads project overview
  • @server.js → References backend logic
  • @/components/Button.tsx → Targets a specific UI file

How to use @mentions (step-by-step)

  1. Reference the exact file or resource
  2. Give a clear instruction
    Example: “Read @README and summarize the architecture.”
  3. Limit scope
    Prevents Windsurf from modifying unrelated files

Why this works:
You eliminate guesswork by forcing the model to use real project data instead of assumptions.

Bottom line: @mentions are the fastest way to inject precise, relevant context.

What is "Impersonation" in Windsurf and How Does it Work?

Impersonation is a technique where Windsurf adopts a specific role or persona to guide its outputs.

This is similar to role-based prompting, a widely used technique where assigning a role improves output relevance and tone (OpenAI Prompt Engineering Guide).

This is useful for tasks that require a particular perspective, such as design, QA, or architecture.

Example of impersonation

“Impersonate a senior UX designer focused on usability.”

Advanced use: Persona files

You can create reusable profiles (e.g., @luna.md) that define:

  • Tone
  • Priorities
  • Constraints

Then use: “Impersonate @luna”

Use cases for Impersonation

  • UX/UI design perspectives
  • Code review roles
  • Architecture decision-making
  • Testing and QA validation

Why it works

Impersonation narrows the model’s decision space by:

  • Defining priorities (e.g., usability vs performance)
  • Applying consistent criteria across outputs

Real-world workflow tip: In practice, teams use impersonation to:

  • Generate quick prototypes (HTML/CSS)
  • Validate ideas before implementation
  • Run AI-powered code reviews after development

Conclusion: Impersonation adds focus and expertise to AI outputs.

Rules vs Memories vs @mentions vs Impersonation

Feature Purpose Scope Best Use Case
Rules Define behavior Global / Project Consistency
Memories Store context Project Long-term projects
@mentions Inject data Instant Precision
Impersonation Change perspective Task-based Specialized outputs

How to give Windsurf the best context (Checklist)

Use this checklist before prompting:

  • ✅ Define clear rules
  • ✅ Add key memories
  • ✅ Reference files with @mentions
  • ✅ Use impersonation for complex tasks
  • ✅ Keep instructions short and specific

Common mistakes when using Windsurf

  • ❌ Giving too many rules at once
  • ❌ Not updating memories after changes
  • ❌ Writing vague prompts
  • ❌ Not referencing actual files
  • ❌ Expecting Windsurf to “just know” your project

Fix: Always provide explicit, structured context.

Final Summary

To get better results from Windsurf, you need to control its context.
Use rules for consistency, memories for persistence, @mentions for precision, and impersonation for focus.

The clearer your context, the better your code.

Related Articles

View all articles

·

Aug 14, 2026

Running Synthetic Users Into Claude Code

A synthetic user research framework, turned into a Claude Code plugin that runs automated UX tests with AI agents, step by step.

12 read time

Read more

A synthetic user is a constrained AI decision agent defined by twelve fields, from functional role and context to assumptions and abandonment rules.

In the previous post I built an early, working implementation, and the next question was whether the same rules could hold up in a repeatable, automated test.

This post is that next step: how I turned the framework into a Claude Code plugin, and the technical decisions behind adapting methods designed for people into something an AI can execute without cheating.

Why “find the usability issues” is not enough

Give a model a URL and ask it to “find the usability issues.” It works halfway. And the “halfway” is the interesting part, It gives you a generic list, correct in the abstract, useless in practice.

A usability issue matters because of who encounters it and under what conditions.

Using an app from bed is not the same as using it on a factory floor. Urgency changes, lighting changes, attention changes, previous knowledge changes. The same confusing button can be irrelevant to a power user and an abandonment point for an operator wearing gloves.

The whole design comes from that observation: the AI does not evaluate the interface. It acts as a specific person in front of the interface.

The person brings the context with them. And the context turns a list of defects into a list of priorities.

Anatomy of a simulation

An orchestrator controls the browser through Playwright MCP. It reads each screen as an accessibility snapshot: text, roles, states, no guessing pixels. Then it acts on specific elements.

The decision on each screen is made by an isolated subagent, which returns a JSON for each step:

{

  "action": "...",

  "clarityLevel": "High|Medium|Low",

  "doubtDetected": true,

  "reason": "...",

  "abandoned": false,

  "estimatedTimeSeconds": 40,

  "emotionalState": "...",

  "memory": "..."

}

Two rules make this look more like a person and less like an oracle.

1. The evaluator never sees the end.

The evaluator receives one screen at a time, without knowing how many are left or what comes next in the flow.

If the interface leaves room for a mistake, the synthetic user makes the mistake. It clicks where a person would click, not where it is convenient to click in order to complete the test. This is where the framework’s forbidden assumptions live. The agent cannot assume backend logic or mentally complete what the screen does not show.

2. Emotion is memory, not decoration.

The memory field travels from one step to the next. The emotional state is inherited and accumulates. A frustration +1 persists. This detects something that is structurally invisible to any test that evaluates screens separately.

Screen five does not necessarily fail because of screen five. It fails because the user gets there with accumulated frustration.

Evaluated alone, that screen passes. Evaluated by someone carrying three doubts and one broken promise, it triggers abandonment. In the first post, I wrote that doubt is not failure. It is the signal that reveals structural friction.

Emotional memory is that idea turned into architecture.

Eight subagents, one job each

Each subagent gets a clean context. It knows the minimum required to do its job.

That ignorance is deliberate.

The agent acting as the user does not know what the orchestrator knows. It cannot compensate for bad design with knowledge a real person would not have.

Subagent

What it does

Subagent What it does
synthetic-screen-evaluator Acts as the user on one screen and returns the JSON for that step
synthetic-flow-synthesizer Reads the complete run and writes the report. It never simulates again
synthetic-profile-generator Generates a complete profile from an approved spec, choosing from a controlled vocabulary
synthetic-autopilot-synthesizer Consolidates N runs and classifies findings by convergence across users
heuristic-persona-generator Creates the 3 persona raters based on the business being evaluated
heuristic-expert-evaluator Detects violations of the 10 heuristics using forced enumeration
heuristic-persona-rater Scores each finding from the experience of ONE persona. It runs ×3
heuristic-report-synthesizer Builds the final report using the already computed numbers

Adapting a human test: the heuristic evaluation

A textbook heuristic evaluation uses three to five human evaluators because each human finds different problems.

My first experiment was literal, and it went meh.

I iterated until I reached two synthetic detection runs with different agents, coverage was extremely high, but it exposed another problem: an unmanageable list. Dozens of valid issues, very few important ones.

The final design separates those two jobs.

1. An expert finds violations.

Based on Nielsen’s literature, an expert goes through each screen and is forced to produce a verdict for every heuristic: 

  • Violation
  • Clean
  • Not observable

Each verdict includes textual evidence from the snapshot, forced enumeration breaks the habit of reporting only the things that stand out.

2. Three synthetic personas decide what matters based on what they bring with them: context, emotions, urgency, and constraints.

Three synthetic personas are generated according to the business being evaluated: 

  • power user
  • average user
  • low digital literacy

They score the findings without seeing the expert’s conclusions. The same issue can matter very differently depending on what each persona brings to it.

The formula is business impact × usability impact, with agreement between personas as the tiebreaker.

This keeps issue detection and user impact as separate jobs: the expert identifies the violations, and the personas help determine which ones deserve attention first.

Three modes, and a tool for building users

The plugin currently has three modes.

simulation-run (custom)

You build a profile field by field in the Synthetic User Builder, the tool I built to materialize the framework.

First come the attributes: 

  • Role in relation to the product
  • Boundaries
  • Initial emotional state
  • Context
  • Forbidden assumption

Only after that, and separately, comes the task.

The profile describes how someone decides, never what they have to do. That is why the same profile can be reused across tests.

simulation-auto (inferred)

You only give it the URL.

It researches the business, infers the typical roles, proposes users with tasks, and you adjust that proposal in natural language before anything runs.

heuristic-test (inspection)

The heuristic test described above, for one screen, one flow, or the entire site.

Everything run becomes a file

Every run leaves Markdown artifacts inside the project:

user-simulation-tests/

├── simulation/

│   ├── profiles/    ← users: the .md used for simulation + a .builder.json

│   │                   that can be imported back into the Builder and edited manually

│   └── results/     ← one report per run + the consolidated report from auto mode

└── heuristic/

    ├── personas/    ← the 3 raters + business research, reused across runs

    └── results/     ← reports with the prioritized findings table

Simulation reports include the full step by step flow, the emotional arc, risks, and a single “Fix this first.”

The consolidated report classifies findings by convergence: did one user suffer from this, or did all of them?

The decision to keep everything as accumulating .md files is strategic.

These are different runs, using different lenses, that can be analyzed together later, crossing heuristic violations with simulated emotions answers something no individual test gives us:

Of everything that is wrong, what actually matters?

Models and costs

What worked for me for the synthesis subagents:

  • For reports, consolidation, and the heuristic expert, the best available model makes sense. That is where the judgment lives.
  • For the screen evaluator, a medium and fast model is enough. There are many short, constrained calls, and the profile already restricts the decision.
  • The raters are the lightest case.

A complete run consumes between 100k and 400k tokens, depending on the model and mode, in around 20 minutes.

That is the cost of a test that previously required coordinating the schedules of three professionals, and that can now run against every iteration of the product.

See it in action

Here's a complete run against our site, kzsoftworks.com: a skeptical "Business Leader" profile, five live browser steps, and a full Markdown audit in under three minutes that names the exact moment the executive persona lost trust.

It is still early, but it already runs

Every rule in the framework became an architectural constraint: clean context, one screen at a time, emotional memory, forbidden assumptions.

The plugin is open source: github.com/PabloManzoni/user-simulation.

Three commands, and the inferred mode only needs your URL.

If you try it and your synthetic user abandons on screen three, you already know what it means:

It is not failure. It is the signal.

·

Aug 14, 2026

Generative UI: How to keep the experience under control

Generative UI can adapt interfaces to each user, but it adds risks around reliability, latency, cost, security, and accessibility. Learn the architecture that keeps those risks under control.

12 read time

Read more

Generative UI assembles the interface around what each user is trying to do, instead of showing everyone the same fixed screen. That flexibility comes with real considerations: keeping the experience consistent, secure, and easy to support once it's live. This post covers what generative UI is worth building for, what it costs, and how teams keep it under control.

Generative UI works best when the experience is dynamic, but the system behind it stays tightly controlled.

Start by defining which parts of the interface can change, which cannot, and what must be validated before anything reaches the user.

TL;DR

  • Interfaces can adapt to user context, support more variations without designing every screen by hand, and reduce unnecessary steps in a workflow.
  • The trade-offs include inconsistent experiences, unreliable or unsafe output, added latency and infrastructure cost, and harder analytics and debugging.
  • Better prompting can reduce unwanted behavior, but it cannot guarantee reliability, security, or consistency. Those controls need to exist around the model: a stable interface shell, a closed component catalog, validation of model output, session-level logging, and model routing with fallback options.
  • Every control introduces a trade-off. No architecture maximizes flexibility, reliability, privacy, performance, and cost at the same time.

What does generative UI make possible?

Interfaces that adapt to context

The interface can adapt to what a person is trying to do instead of relying only on a persona defined at design time. Steps can reorder or disappear based on intent. It can change how much information it shows and what it emphasizes. Copy can adapt to the user's locale and context instead of relying on literal translation.

More interface variations with less custom development

A small set of components can support many variations without designing each screen separately. The system can also support workflows the team did not design as individual screens, as long as the required components and actions already exist.

Fewer steps between intent and action

The interface can hide controls a task does not need, reducing the number of steps required to complete it. Generative UI can also help teams test different ways of presenting the same task. Whether that improves completion or conversion depends on the workflow.

What can go wrong with generative UI?

Experience consistency risks

When layouts change between users or sessions, they can break muscle memory and make support harder. They can also drift from the design system or disrupt accessibility patterns that depend on consistent structure.

Reliability and security risks

The system should not trust model output by default. A model can render a button that does nothing, display fabricated data in a component, or produce a state the team never tested. Prompt injection can push it toward components, content, or actions the system should not allow. Weak controls can expose sensitive data or allow actions and interface states the product should block.

Performance and infrastructure risks

A generative interface also inherits the model layer's latency, cost, and availability risks. Waiting on an LLM to generate a layout adds delay before a page renders. Each generation uses processing resources, and hosted models usually add usage-based cost. Relying on one provider also exposes your product to outages, API changes, price increases, and deprecations.

Analytics and debugging risks

Standard analytics often assume a fixed set of screens. Heatmaps and funnels become harder to compare when users see different layouts. Reproducing a bug also gets harder when you cannot reopen the exact screen the user saw.

How do you control these risks?

Prompts can reduce unwanted behavior, but they cannot enforce which components the system may render or which actions it may allow. Those limits need to be enforced in the architecture around the model.

What parts of a generative interface should remain fixed?

Keep global navigation, account and security controls, primary actions, critical transaction controls, and accessibility-critical structure fixed. Let the model modify only the content and controls that benefit from adaptation.

Fixed navigation preserves familiar interaction patterns. A stable structure also makes accessibility testing, branding, and support more predictable.

How do you stop generative UI from creating broken interfaces?

Do not let the model generate arbitrary UI code. Have it return structured configuration instead. The schema should specify the component, its data, and its position. Validate that output against a closed catalog before rendering it.

The model should not write HTML, CSS, or JavaScript or choose anything outside that catalog. This reduces invalid layouts and unsupported combinations. This is the declarative approach we covered in Part 1.

How should teams test and secure generative UI?

Treat model output as untrusted input. Validate it against the schema and component allowlist, sanitize content, and keep authorization outside the model.

Add content security policies and prompt-injection defenses based on what the model can access and what actions it can trigger. Pay particular attention to user-provided content, privileged actions, sensitive data, and external tools.

Limit valid component combinations, then use visual regression and property-based tests to exercise unexpected inputs and edge cases.

Minimize sensitive data sent to the model. Mask or anonymize it before generation when the task does not require the original values.

How do you monitor a UI that looks different for every user?

Record enough context to reconstruct each generated interface. That includes detected intent, model version, generated configuration, rendered components, task completion, and errors, all tied to the session.

That record lets teams segment analytics by generated experience and reconstruct what a user saw during a specific session.

How do you control latency, cost, and outages?

Cache reusable results where freshness and privacy allow. Show a skeleton layout immediately and stream the rest in. Route simpler requests to smaller or local models, and reserve larger ones for complex requests. Put providers behind the same integration layer so you can switch models or fall back to a static experience during an outage.

What it controls Risks it mitigates
Stable interface shell Keeps navigation, account controls, and primary actions fixed Muscle memory loss, brand drift, accessibility gaps, support friction
Component-based UI Model outputs configuration, not code UI hallucinations, broken layouts, brand inconsistency, testing complexity
Untrusted-input handling Schema validation, allowlists, sanitization, sensitive-data controls Prompt injection, unsafe states, fabricated actions, privacy exposure
Session-level logging Records intent, generated configuration, rendered components, and outcome Fragmented analytics, hard-to-reproduce bugs, support friction
Model routing and fallback Caching, streaming, model routing, provider switching Latency, model cost, provider downtime, difficulty switching providers

What do these controls cost you?

Keeping more of the interface fixed protects consistency but limits personalization. Limiting combinations makes the system easier to test but reduces how much it can vary. Caching lowers cost, but cached output can go stale.

Running models locally can reduce how much sensitive data leaves your infrastructure, but it adds systems your team has to operate and maintain. Detailed session logs can make support easier, but they also create storage, retention, and privacy requirements.

No architecture maximizes flexibility, reliability, privacy, performance, and cost at once. You need to decide which trade-offs matter most for each workflow and design around them.

llms.txt