HackBlue

Tools · LLM application security · 25 / 27

The role field is not the account

Role names the message slot. The account is a different field. Do not treat the word user as who sent it.

10 min read · practice only with authorization

Role names the slot

A message can carry a role such as system, user, assistant, or tool. That word says which slot the text occupied. It is not an account name, and it is not a permission.

Several people can send messages with role user. The word does not tell them apart.

The account is another field

The account, when the log has one, is the caller id stored beside the turn. That is who the application says sent it. The role stays the slot even when the account changes.

If the account field is empty, write that the account was not logged. Do not copy the role into that blank.

What the note keeps

File the role and the account on separate lines, with the request id. A sentence about who asked uses the account. A sentence about which slot a string was in uses the role.

Worked case: the word user filed as the person

A lab message shows role user and account acct-44 on request req-820. A draft says the person is named user, and does not mention acct-44.

The note says the slot was user and the account was acct-44. The word user is not an account. A second message with the same role and a different account would be a different caller.

Snippet
request: req-820
role: user
account: acct-44
write: slot and account
not: an account named user

Diagram

Keep the slot off the account line

  1. Role

    Which slot the text occupied.

    Slot
    user
  2. Account

    Who the application logged.

    Caller
    acct-44
  3. A second account

    Can use the same role.

    Note
    still a different caller
  4. Empty account

    Say it was not logged.

    Note
    do not copy the role

Check yourself

1. A message has role user and account acct-44. What is the word user?

2. Which field says who sent the turn?

3. The account field is empty. What do you write?