StoryboardAI Engineering

Access control

Deciding in code, not in the prompt, whose data a request is allowed to touch.

What is access control?

An assistant with tools can look up real records. That raises a plain question: whose? If the model chooses which customer to look up, then anyone who can persuade the model can read anyone's data.

The fix is to take that choice away from the model. The server already knows who is logged in. It fills in that identity itself, and the tool will only ever return that person's records, whatever the model asked for.

The general rule: instructions in a prompt are requests, and can be argued with. Checks in code are rules, and cannot. Anything that must never happen belongs in code.

Filtering happens before the model, not after.Step 1: A request carries who is asking. Step 2: Search is filtered by that identity. Step 3: Only permitted text is returned. Step 4: The model sees nothing else.1A request carrieswho is asking2Search is filteredby that identity3Only permittedtext is returned4The model seesnothing else
Filtering happens before the model, not after.

Why does access control matter?

An assistant that searches a company's documents can surface anything in them, to anyone who asks. Without controls, a junior employee can ask their way to salaries, or one customer to another's order. The assistant must be able to see only what the person asking is allowed to see.

How does access control work?

  1. Every document, record and memory is stored with a label saying who may see it.
  2. Every request carries the identity of the person asking, taken from their sign-in.
  3. Searches and lookups are filtered by that identity before anything is returned.
  4. The model receives only what passed the filter, so it cannot reveal the rest.

When should you use access control?

Use it when

  • Different people may see different data
  • An assistant serves more than one customer or team
  • Stored memories or documents are personal

Think twice when

  • Everything the assistant can reach is public

Where does access control sit in a real system?

It is enforced in the data layer: the search index, the database, the tools. It must happen before text reaches the model. A filter applied afterwards, or a rule in the prompt, comes too late.

What goes wrong with access control?

  • Retrieving everything and asking the model not to mention the private parts.
  • Taking the person's identity from what the model wrote.
  • Sharing a cache of answers between people with different rights.

What does access control look like in practice?

A club member and a committee member ask the same question. The search runs with each person's identity. The member's results exclude the committee's meeting notes. The model answering the member never sees those notes, so no wording of the question can draw them out.

Watch it happen

These stories show access control at work, one step at a time.