With the target gate on, only the tool URL was checked and the proxy in the
tool's proxy field was dialled without a check, so an approved target could
be fetched through any host and port. Read the proxy as a target, as a proxy
named on a Bash command line is: the call waits for its approval, the
request records the proxy without credentials, and the proxy is dialled
through the pinned dialer. The recording and global proxies, required mode
and the gate-off paths are unchanged.
Regex and string intercept rules were matched on the raw tool input,
but Bash removes quotes and backslashes and decodes $'...' before it
runs a command: r\m -rf, r''m -rf, rm -r''f, rm -R -$'f' and a
backslash-newline inside a word all ran rm -rf while the built-in
recursive-force-delete rule did not match, and so did rm -rf on the
line after another command, because the JSON escape of the newline
glued an "n" to the command name.
A deny or ask rule on a Bash call now also meets the command decoded
with the argv word decoder, the simple commands joined by "; ". Allow
rules are still matched on the text as written. The word decoder now
decodes ANSI-C strings instead of treating them as opaque, which also
lets argv deny and ask rules meet $'nmap' and bash -c $'nmap x'.
A fuzzy_ip rule compared the raw strings, so a block rule "::1" let
insert_assets register "0:0:0:0:0:0:0:1" or "::0001", and a rule
written expanded missed the compressed address. Match each candidate
as written and in its canonical form, and canonicalize a pattern that
is a whole address; a partial pattern keeps its substring meaning.
cidr rules now also match a zone-qualified address, and a
zone-qualified IPv6 URL host is classified as an IP in insert_assets
and for stored assets, so exact_ip, fuzzy_ip and cidr rules see it.
writeTaskArchivePackage listed each directory of the staged run tree and
then opened its files by full path as root. Code running as the executor
uid with a working directory inside the moved run tree could swap a
listed directory for a symlink, so later children were read through it
and root-only files outside the payload were copied into the archive,
then handed back to the executor group on restore.
Walk and open the payload through an os.Root anchored at it, so no
lookup can leave the payload, and refuse the archive when an opened file
is not the regular file the walk listed. Add regression tests that swap
a directory or a file for an outside, a ../ or an inside symlink right
before the packer opens it, plus guards for existing symlinks and for
link and nested ../ entries on extraction.
Norma adds Monitor, TaskOutput, TaskStop and TaskList to each session
unless DisableBackgroundTasks is set, and only the connection test and
the goal decomposer set it. Monitor starts a shell command in the panel
process, outside the sandbox Bash goes through, so with
ARTEX_SANDBOX=required a worker, planner, chat or main-agent model could
run commands in the panel container.
All agent sessions are now built by newSession, which sets
DisableBackgroundTasks while the sandbox is required and turns a nil
tool list into an empty one (Norma reads nil as "install my default
file and shell tools"). With the sandbox off the tools stay: local Bash
needs the same task manager for background runs, the pause kill switch
and the interactive shell. The tool catalogue resolver no longer
returns nil when the tools table cannot be read.
Tests drive each production session (chat, Auto chat, goal
decomposition, planner, main agent, worker, captureRun) under the
required sandbox mode and fail when a background-task tool is offered
to the model, check that no file calls agentcore.NewSession directly,
and check the resolver's catalogue failure path.
The extra sentence appeared with the host path outside sandbox mode,
where it is false. Add it only when SandboxRequired, pin that with the
host test, and cover workerArtifactSpec in the sandbox test.
Move promptWorkDir above the artifactSpec doc comment, and stop
claiming that the container absolute path works for file tools: those
run in the panel and take relative paths. Add the sandbox and non
sandbox tests and the CHANGELOG entry.
In SANDBOX=required mode the agent's filesystem is the worker container's,
where the per-intent run dir is mounted at /workspace/<leaf>.
artifactSpec/workerArtifactSpec told the agent the panel host path under
/app/data/tasks instead. Because only the cwd is remapped into the
container (not absolute paths inside a raw shell command), the agent would
write intermediate artifacts to a read-only /app and silently fail, losing
captured response bodies and scripts.
Add promptWorkDir(), which returns the container path in sandbox mode and
the host path otherwise, and route both specs through it. Also tell the
agent explicitly not to invent paths under /app.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Exclude content/safety refusals from the failover-health score so repeated
refusals of one prompt no longer trip a healthy profile's circuit breaker
(RecordCall: neutral — no Trip, no Pass).
- Match specific provider refusal codes (cyber_policy, content_policy_violation,
invalid_prompt, Azure content_filter) instead of loose words; drop the bare
'safety' marker that caught OpenAI safety_identifier / Gemini safety_settings.
- Refresh the stale shouldFailover doc comment.
- Add tests (shouldFailover code matrix, RecordCall refusal-neutrality) and a
CHANGELOG entry.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Give only active finding retests their own runner identity and workspace. Reuse the source task operator-approved egress scope, keep target approvals, and clean up runtime resources on completion or cancellation. Drain conversation cleanup during shutdown. Related to #805; ordinary standalone chats remain unsupported in required mode.
Add the variable to the runner environment of the three compose files,
document it in .env.example, docs/SANDBOX.md and the CHANGELOG, and
correct the TaskDNS comment: only the egress proxy resolves names.
- parseDNSList: split on comma or any unicode.IsSpace rune so tabs and
newlines in ARTEX_TASK_DNS act as separators, not address bytes.
- proxySpec: add HostConfig.Dns only when the list is non-empty so the
serialized spec is byte-identical when ARTEX_TASK_DNS is unset.
- workerSpec: drop Dns entirely — the worker sits on the --internal
task network and resolves through the egress proxy; setting Dns there
would relay worker DNS around the proxy.
- add cmd/artex-runner/main_test.go: TestParseDNSList covers valid
comma/space/mixed/newline-separated lists, IPv6, empty and
separator-only input, invalid entries dropped (with valid kept),
hostnames dropped, and asserts every output entry parses as an IP.
On Docker Desktop the embedded resolver (127.0.0.11) forwards to the
host's resolver path; when that path is slow or changes underneath
running containers (host roaming networks), per-request DNS in the
worker and egress proxy exceeds resolve budgets or times out entirely.
ARTEX_TASK_DNS (comma/space separated IP list) sets HostConfig.Dns on
every runner-created task container (worker + egress proxy). Empty
keeps Docker's default. Invalid entries are dropped with a warning:
DNS placement is a reliability knob, not a security control — the
egress proxy's scope allowlist remains the security boundary.
Storage step of the multi-user work in #790 (phase 2a).
Migration 0029_users.sql adds three tables:
- users: case-insensitive unique username, display name, optional email,
optional bcrypt hash (SSO-only users have none), account source
(local now; oidc, saml, ldap, scim later), break-glass flag (local
accounts only), disabled, login and update times.
- user_identities: links a subject at an identity provider to one user,
unique on (provider_id, subject). An identity is never linked by
matching email or username.
- user_sessions: one row per token id (jti) with expiry, last use,
revocation, user agent and client address.
The migration seeds the existing ARTEX account as the break-glass local
user, so later changes have a row to point to. It does not copy the
password hash: login still reads the auth.password_hash setting, and a
copy would go stale when the password changes. The change that moves
login onto these tables moves the hash with it. An existing ARTEX row is
left unchanged.
Every CHECK constraint is named, so a later migration can alter it by
name. Usernames are at most 128 characters without control characters.
Only a local account can have a password (users_password_local_only), so
an account from an identity provider cannot gain a second way in. The
session user agent is at most 512 bytes and the client address 64; the
address is TEXT because the peer is not always an IP address.
db/users.go adds the store functions later phases need: create and look
up users, set a password, disable a user (which also revokes its
sessions), link and resolve identities, and create, read, touch and
revoke sessions and delete expired ones. The Go side applies the same
limits first (ErrUserInvalid; user agent and address are cut). A session
is created only for an existing, enabled user (ErrUserDisabled), is not
active and cannot be touched while its user is disabled, and a missing
row means no session. DisableUser refuses the last enabled break-glass
user (ErrLastBreakGlass), locking the break-glass rows so two concurrent
calls cannot disable the last two. Expired sessions are deleted by the
database clock, as TouchSession checks expiry.
Nothing reads these tables yet. Login still uses the single ARTEX account
and the setting, so behaviour does not change.
A successful load after a failed search must clear the error even when
the rows, total and counts match the state the failed search left
behind. Without the !dslError check the reducer returns that state and
the error stays visible.
Review of the scope filter:
- netip.ParseAddr accepts any text after % as an IPv6 zone, commas
included, so "fe80::1%eth0,10.0.0.0/8" was kept and the comma join
added 10.0.0.0/8. Zoned addresses are now dropped, and every kept
entry is passed on in canonical form (p.Masked().String(),
a.String()), which never holds a comma or space. IPv4-mapped entries
become the IPv4 range they map.
- The cap was 1,024 entries; a company scope can be larger. It is now
8,192 entries and 120 KiB per list (the proxy gets each list as one
environment string, limited to 128 KiB).
- The runner logs dropped entries with the task ID and their values (up
to 20), so an operator can see why an approved target is refused.
- More names that make a shell or interpreter run extra code are
refused: SHELLOPTS, BASHOPTS, PS4, IFS, PROMPT_COMMAND, GLIBC_TUNABLES,
PYTHONSTARTUP, PYTHONHOME, NODE_OPTIONS, PERL5OPT, PERL5LIB, RUBYOPT,
JAVA_TOOL_OPTIONS, GIT_SSH_COMMAND, GIT_CONFIG_PARAMETERS.
ValidateEnv refused secret-looking names only. An exec request could set
HTTP_PROXY, HTTPS_PROXY, ALL_PROXY or NO_PROXY (any case) and send the
command around the egress proxy, or set PATH, LD_* (LD_PRELOAD,
LD_LIBRARY_PATH, LD_AUDIT, ...), BASH_ENV, ENV, GCONV_PATH or PYTHONPATH
and run code before the command. In the Docker backend the exec Env
overrides the worker container's env, so this applied there.
- ValidateEnv refuses these names with 400. FilterPanelEnv drops them, so
the panel does not send a request the runner refuses.
- ValidateExecRequest checks every scope entry: a domain must be a host
name (optionally "*."), a CIDR entry a valid prefix or address. Both
backends join the entries with commas into the egress proxy
environment, so "1.2.3.4/32,10.0.0.0/8" added an entry nobody
approved. Invalid entries (including any with a comma or a space) are
dropped whole, never split, and the valid ones are kept: the panel
builds scope from free-text fields, and a narrower scope fails closed
at the deny-by-default proxy. The runner logs how many entries it
dropped. More than 1,024 entries in either list is still a 400.