HackBlue

Tools · LLM application security · 21 / 23

The user id is who sent the turn

The user id on an application log is the account that submitted the turn. The model id is what produced the text. Write them as different fields, and do not treat the user id as the author of the reply.

11 min read · practice only with authorization

The user id is the account

The application records who was signed in when the turn was sent. That id is the caller. It is not the model, and it is not a person named inside the generated sentence.

If the field is a service account, say so. A service account is still the caller. It is not “the model acting on its own.”

The model id stays on the response

Which model produced the text is the model field on the response, when that field is present. Quoting the user id in that slot swaps the caller and the generator.

A sentence in the reply that names a person is generated text. It does not update the user id. The account on the log remains the account that sent the turn.

What to file

File the user id, the response id, and the model id if you have it. When you say “the user asked,” point at the user id. When you say “the model wrote,” point at the model id and the response id.

Worked case: a reply name copied into the caller field

Turn req-720 was sent by user lab-reader. The response model is lab-hours-small. The reply text mentions “ask the night editor.” A draft sets the caller to night editor because that is the person the sentence names.

The note keeps lab-reader as the user id and lab-hours-small as the model. “Night editor” stays inside the reply text. It is not the account that sent the turn.

Snippet
request: req-720
user id: lab-reader
model: lab-hours-small
reply mentions: night editor
write: caller is lab-reader
not: the caller is the night editor

Diagram

Three names that get swapped

Only the user id is the account that sent the turn.

  • User id

    The signed-in account on the application log.

  • Model id

    What produced the text, from the response.

  • A name inside the reply

    Generated text. Not an account field.

  • A missing user id

    Write that it is missing. Do not borrow the model id.

Check yourself

1. The log user id is lab-reader and the reply mentions a night editor. Who sent the turn?

2. The user field is empty. What do you put there?

3. Which field supports “the model wrote this sentence”?