System variables

The sys namespace carries what the runtime knows about a run. Three names are always there. Four more reach an agent only when a developer lists them here, so by default an agent sees nothing about the user or the server. See Variables and namespaces for how an expression reads them.

Always present

  • sys.inputs is the inputs the agent was called with.
  • sys.query is the user's query.
  • sys.secret reads a secret by name, as sys.secret['name']; see Secret vault.

Enabled here

ValueMeaning
userEmailEmail of the user.
userSessionA hashed value of the session ID of the user in the agent server. This can be used to store data that is specific to the current user session.
serverIpIP address of the agent server as seen by the cloud. This can be used in logging server specific activity.
cookiesUser cookies in the request. This can expose the raw session ID of the user and other such secret values. This needs to be used carefully.

cookies deserves care. The cookies carry the user's raw session ID, and an agent that writes the cookies into its output, a variable or a call to an outside system has given that session away. We would suggest enabling cookies only for an agent that needs them, and never letting the value leave the server.

FieldTypeDefaultDescription
sysVariableslist of "userEmail" | "userSession" | "serverIp" | "cookies"Which system variables agents can read from the 'sys' namespace. 'inputs' and 'query' are always available.