mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-11-13 11:40:53 +08:00
ARTEX_UNTRUSTED_BOUNDARY unset or empty now enables the boundary. 0, false, off and no (case-insensitive, trimmed) disable it; any other value keeps it on. Docs state the default, the opt-out and the measured cost (about 154 bytes per tool result plus one system note).
20 lines
599 B
Go
20 lines
599 B
Go
package agent
|
|
|
|
import (
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
// untrustedBoundaryEnabled reports whether Norma's untrusted-output boundary
|
|
// (agentcore.Options.UntrustedOutputBoundary: tool results framed between
|
|
// nonce-tagged markers) is on. It is on by default: unset, empty or any other
|
|
// value keeps it on; only ARTEX_UNTRUSTED_BOUNDARY set to "0", "false", "off"
|
|
// or "no" (case- and space-insensitive) turns it off.
|
|
func untrustedBoundaryEnabled() bool {
|
|
switch strings.ToLower(strings.TrimSpace(os.Getenv("ARTEX_UNTRUSTED_BOUNDARY"))) {
|
|
case "0", "false", "off", "no":
|
|
return false
|
|
}
|
|
return true
|
|
}
|