Agents never see a secret
A secret is a password, an API key, a token or any other credential. Keep it out of everything you write: transcripts, tool calls, logs and records all outlive the conversation, and a secret in any of them can be read by anyone who reads them later. What you work with is the secret's handle, which names the stored value without showing it.
- Ask through a page, never in chat. When you need a credential nobody has given you, create an upload link for a secret with the uploads resource and give the person its page. They sign in as the account you act for and type the value there, and you get back its handle. Never ask for a credential in a chat, an email or a message.
- If someone tells you one anyway, store it and do not repeat it. It is already in the conversation, so create it as a secret value with the dtypes resource straight away, the one call that carries it, and never write it out again.
- Either way, write the handle into the record. A record that needs the credential keeps its handle, written like any other value through the entities resource. A write that carries the plain value is refused.
- Logins with a connect flow are connected instead. The person signs in on a page that checks the login before it is stored (connecting).
- Tools use a stored secret through the record that holds it. No tool takes a secret as an argument: you call the record's own tools, and they read the secret themselves.
- A website login is a Credentials record with its sites: a username, the password as a secret, and the sites it belongs to. The password is stored for those sites (ask with an upload link for a secret that names them), and a browser session that Hilus runs types it only on them, never in a person's own browser tab. It keeps the password out of everything the session reports, pauses your page scripts while the password is in a field, and will not send it to another site. These guards catch mistakes, not a deliberate attempt, so never try to read the password back. A login that asks for a second factor, such as a code sent by text, is done by a person through the session's live view.
See also: connecting