Master

A channel the model cannot write into

The end state of this subject is not a better prompt. It is an architecture where the instruction and the data never share a channel, so the strongest injection in the world has nothing to aim at.

What you will see

One now, zero after the fix. Zero on the running system is the proof.

About 1 min of reading

Try It

Audit the one merge point

1

Find every place user text is concatenated

grep -rn 'prompt +\|+ userText\|template' --include=*.js . | head -20

Before you run it, say out loud what it will print. Then open the answer.

What it prints
A short list. More than a few means the channels are not separated yet.
2

Name the one allowed merge

printf 'merge(instruction, data) is the only entry\n' > /tmp/merge.txt; cat /tmp/merge.txt

Before you run it, say out loud what it will print. Then open the answer.

What it prints
One line. Every other concatenation is a bug against this rule.
3

Attack the merge and require a fail

printf 'close-attempt win\n' > /tmp/attack.txt; grep -c ' win' /tmp/attack.txt

Before you run it, say out loud what it will print. Then open the answer.

What it prints
One now, zero after the fix. Zero on the running system is the proof.

Data Flow

Two channels to one audited merge
1 The instruction channel is built by code
↓
2 The data channel is built from user input
↓
3 One merge function combines them
↓
4 The suite attacks that one function
Why this works
Why the merge function is the whole defence

One merge point means one place to audit. Every input list in the Basic tier points at that same function.

The test that proves the channel

An attack that tries to close the data channel and fails, on the running system, is the proof. Not a claim in a document.

Examples

Two channels, one merge point

The instruction channel is written by code and read by the model. The data channel is written by users and read by the model. They merge once, and the merge is a function.

Why markers alone never get you here

A marker can be guessed or copied. A channel that is a separate field in an API call cannot be entered from inside the other field.

The cost of the real fix

It costs a rewrite of the request builder. That cost is why it is done once, at the bottom, instead of per prompt.

Words this lesson uses

Each one is defined here on this site. Open the entry for the full definition and the other words it points at.

← A written policy for what is unsafe
Previous Lesson
A written policy for what is unsafe
Next Lesson
Measuring the defence over time
Measuring the defence over time →