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.
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.
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
- Role
Which slot the text occupied.
user
- Account
Who the application logged.
acct-44
- A second account
Can use the same role.
still a different caller
- Empty account
Say it was not logged.
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?