interface RuleDescription says what this rule lets the sandbox reach, so an agent driving the sandbox can be told its capabilities. At most 1024 characters.
EnvVars are plaintext env vars set for every command in the sandbox while this rule is enabled. Use them for tools that refuse to run unless a credential env var is present (e.g. gh needs GH_TOKEN) even though this rule injects the real credential on the wire — set a dummy value here so the command starts. Explicit per-sandbox env_vars win over these, and provider-managed (AWS/GCP) vars win over both.
MatchHeaders restricts a header injection or rewrite rule to requests carrying every listed header, each written "name: value" with a lowercase name and an exact value. Pair with headers of the same name to swap a placeholder the sandbox sends (e.g. "authorization: Bearer account-b") for a real credential, so one host can serve several accounts. Rules are evaluated in order and the first match wins.
MatchHosts lists the hosts a header injection, rewrite, or relay rule covers. AWS and GCP rules match their provider's hosts built in; there MatchHosts optionally narrows them to the listed hosts (e.g. "sts.amazonaws.com", "bigquery.googleapis.com"), and when empty the rule covers every host the provider can authenticate. A host no rule covers is passed through without TLS interception. Azure rules do not accept it. A relay rule may also list IP addresses and CIDR blocks (10.0.0.0/8), which match connections the sandbox makes to an IP address rather than a name.
MatchPaths restricts a header injection or rewrite rule to requests whose path
matches one of the patterns, so one host can use a different credential per
route. The path excludes the query string. A pattern is an exact path
(/v1/runs); a prefix, written as the prefix followed by a slash and * or
**, which matches any path starting with that prefix (the prefix /v1 also
matches /v10); a suffix, written as *, a slash, and then the ending, which
matches any path that ends with that text (the ending runs also matches
/v1/xruns); or * alone for every path. A wildcard in the middle of a path is
not supported. An empty list matches every path. A request whose path is not
canonical (a . or .. segment, an empty segment such as //, a backslash, or
a percent-encoded slash, backslash, or dot) matches no pattern. Rules are
evaluated in order and the first match wins. Rejected on aws, gcp, azure, and
relay rules.
RelayID is the ID of the LangSmith relay (a connection of kind relay) that carries connections to match_hosts when type is relay. Those connections leave from the relay's connector, and its network and IP, instead of the sandbox host. Access control still applies first, the first enabled matching relay rule wins, and a matched host never falls back to a direct connection.
Type selects the rule action; attribution adds up to 16 literal plaintext X- metadata headers to every proxy-handled HTTP(S) destination, independently of credential rules. At most one attribution rule is allowed, without matching, provider, relay, rewrite or environment fields.