System variables

The sys namespace carries what the runtime knows about a run. Four names are always there. Four more reach an agent only when a developer enables them here, so by default an agent sees nothing about the user or the agent server. See 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.
  • sys.exists answers whether a variable exists, as sys.exists(scope, name); see Python expressions.

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 needs care. The cookies carry the user's raw session ID, and an agent that writes them into its output, a variable or a call to an outside system has given that session away. Enable cookies only for an agent that needs them, and never let the value leave the agent server.

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