Skip to content

feat: add redacted access audit and URL/time search - #596

Draft
renaesop wants to merge 7 commits into
BaaRai:mainfrom
renaesop:codex/access-audit-search-20261127
Draft

renaesop wants to merge 7 commits into
BaaRai:mainfrom
renaesop:codex/access-audit-search-20261127

Conversation

@renaesop

@renaesop renaesop commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Operators investigating an unexpected URL can search retained access observations by URL/path, exact hostname, task, source and time in Traffic → Access audit. Worker Bash subprocesses, including normal curl and Python urllib/requests clients, now produce actual HTTP(S) proxy observations even when full traffic recording is disabled. Command text is never treated as proof of a request.

This is PR 2 of 4, counting design #555, related to #553 and #554. Authoritative gateway/action authorization and the complete Go/bubblewrap Linux backend remain PRs 3 and 4.

  • The execution environment receives an opaque, revocable proxy credential and the local inspection CA. The server resolves the credential to trusted task/worker context, strips it before forwarding, and forgets connection attribution on disconnect. Unknown, malformed and revoked credentials cannot claim a task identity. Exact Bash call IDs remain unknown; request IDs correlate proxy request/response/error events.
  • execution_proxy joins native HTTP/enrichment, WebFetch trace, generic recording-proxy observations and explicitly labeled external ingest/HAR reports. The configured global egress proxy remains upstream of execution inspection. Native clients and browser MCP keep their existing routing choices.
  • The full-capture toggle independently controls automatic body/headers/blob/stream persistence. Capture-off flows stream through; off/on transitions cannot begin capturing an already-running request or resume an old stream. Explicit manual Replay retains its recording/rewrite behavior. Traffic tools and recording prompts remain capture-gated.
  • Audit stores no headers, bodies, userinfo, query parameters or fragments. A bounded background queue batches SQLite writes; overflow/commit failures are counted. Retention is 30 days / 500,000 events, separate from archives and full-capture deletion. The authenticated API returns no-store; URLs render as inert text.

HTTPS inspection changes the execution path: managed proxies verify upstream certificates by default. Self-signed/untrusted targets require the explicit ARTEX_PROXY_INSECURE_TLS=1 operator setting; client-side curl -k does not change proxy-side verification. The local proxy listener and trusted CA must be available.

Coverage remains partial, not tamper-proof isolation. Proxy overrides/NO_PROXY, clients ignoring environment proxies, raw TCP/UDP, opaque/pinned TLS, external MCP traffic and remote SSRF/RCE hops remain outside this collection path. A process able to read another run's environment could copy its capability; hard isolation belongs to the later sandbox work. Missing observations do not prove absence of access. Proxy-enabled WebFetch with direct fallback retains its documented attempt-only limitation.

Validation completed on the requested Linux host before commit/push:

  • Core and server regression suites, followed by the complete traffic suite and focused replay/logging/API regression checks; compatibility regression of the existing customized deployment. Existing conditional skips are documented upstream.
  • Focused race tests cover real curl/urllib/requests subprocesses, HTTP/HTTPS and redirects, body/stream suppression, capture toggles, upstream proxy routing, credential revocation/forgery, malformed credentials on a reused connection, and rejection of untrusted upstream TLS. Final go vet, TypeScript and static frontend builds passed; Windows amd64 cross-build passed.
  • A deployed real ARTEX worker task invoked Bash with curl, urllib and requests. Its 7 HTTP(S) requests produced 14 correlated proxy events, with correct task/worker/Bash attribution. Four local origin receipts matched the audit exactly, including the redirect; three HTTPS responses succeeded. Full capture stayed off, its existing 10 records did not increase, audit write failures were zero, and proxy credentials/query/body/header canaries were absent from audit output. The deployed compatibility build repeated this successfully in a second real task.
  • The upstream checkout was synchronized with current main (e9659c8); all core/server regressions, frontend export, Linux/Windows builds and static checks passed on the Linux verification host. The independent planner-context integration is also covered by a focused race check.
  • The existing service was updated with its private customizations preserved, the active task restored, and rollback retained. The real worker results were also verified in the user's Chrome with the existing English presentation.

See docs/access-audit.md for coverage, TLS, retention and acceptance details. Existing untrusted-content safeguards remain; this change does not claim prompt-injection immunity. Windows is compile-checked, not natively qualified.

Keep this implementation PR Draft. Deployment and automated/controlled-task acceptance are not authorization to mark it ready. The requester must manually retest business scenarios and explicitly approve readiness. No merge is requested.

Audit UI consistency

The audit view now follows the existing traffic and tool-execution lists: a compact toolbar using shared controls, collapsible advanced filters, consistent table styling, and a detail sheet for full attribution. Recent observations load on entry; cursor pagination supports going back to the previous page. Coverage and retention explanations remain accessible from a compact indicator, with write failures still visible in the list.

Validated on the deployment host with TypeScript checks and static builds for both upstream and the compatibility UI; locale checks passed. Chrome checks against actual worker records verified the 14-event task filter, six HTTPS observations under an exact-host filter, empty results, detail and coverage sheets, and navigation back to the unchanged 10 full recordings. The compatibility deployment preserves English and the existing instance customizations. The PR remains Draft pending manual business-scenario review.

Open business-scenario gap: SSRF/RCE-induced access

The operator's requirement is to search a business-reported destination and time window and identify the ARTEX task and exact action that may have caused a remote SSRF/RCE request, without agent-mode workspace scanning. The current direct-network audit alone does not meet that requirement. Query keys/values are removed, request bodies are not retained, and literal tool-input search misses dynamically assembled full URLs.

A real worker ran one successful Bash invocation with full capture off: 100 curl + 100 urllib + 100 requests.Session loop requests, 10 same-path/query-only variations, and 5 mock application first hops. Independent receipts matched all 315 request events and 315 response events, with 315 request IDs, no missing/duplicate events in this run, and zero new write failures. The existing 10 full recordings did not increase. However, the application's five controlled second-hop requests all reached their destination and produced zero worker audit events. This is an HTTP batch/boundary fixture, not an RCE exploit or a remote-egress containment test.

Pending PR 2 acceptance: index command/artifact references and destinations actually submitted in supported query/body payloads before general redaction; retain credential-redacted target structure and exact trusted action/artifact links; distinguish references, submitted targets, network observations and independently correlated receipts; expose limitations for opaque/dynamic payloads. Search must correlate the reported destination to a task/action without live disk scanning. Payload mentions are not proof of second-hop execution, and a local sandbox cannot observe the remote server's network. Corroboration needs callback/OAST or target-side evidence.

Keep PR #596 Draft. Passing direct-request batch tests does not close this investigation gap. These additions remain pending within the existing four-PR plan; no raw query/body retention or new scope enforcement was enabled by this validation.

Confined search follow-up (2026-11-29)

Filename-only literal searches in the confined Go Grep were running a regular expression against every line and calculating counts that the requested output did not use. The follow-up parses the regular expression and uses byte matching only when it can prove the expression is a bounded set of case-sensitive literals. General regular expressions, empty matches, case folding, replacement-rune semantics, count output and content output keep the existing matching path. The existing executor identity, working-directory confinement, binary filtering and hard-link checks remain in place.

Cancellation now propagates into file reads, directory traversal and the per-line matching loop. An interrupted search reports Search incomplete rather than No matches found. This is cooperative cancellation; it does not claim to preempt an individual filesystem call or an already-running regular-expression operation.

On the same Linux acceptance host, a generated corpus of 8,164 files / 512.77 MiB and three literal alternatives produced the same two matching filenames before and after the patch. Completed baseline calls took 57.104, 43.403 and 44.096 seconds; the five patched calls took 2.650, 2.291, 2.225, 2.435 and 2.225 seconds. Medians were 44.096 → 2.291 seconds, about 19.25× for this tool-level workload. The baseline harness reached its 180-second overall cap during a subsequent call; that unfinished call is excluded. Caches were not cleared, and these numbers are not an end-to-end agent or Windows performance guarantee.

Validation on the acceptance host: full go test -race ./agent -count=1, go vet ./agent, Windows agent test cross-compilation, existing confinement/hard-link tests, and new literal/regexp/count/content/cancellation compatibility tests passed. The separate experimental search service is not included in this change, and the running production instance was not replaced by this follow-up.

The PR remains Draft for manual business-scenario review. This improves agent-assisted evidence lookup; it does not close the SSRF/RCE attribution and cross-task audit-search acceptance gaps above, or add an agent-wide search budget/tool allowlist.

After syncing upstream main, the audit entries were added to the newly introduced Vietnamese locale. The acceptance host also passed i18n, TypeScript, all other frontend regression scripts, the static frontend build, full Go build/vet, agent race tests and Windows cross-compilation before the compatibility commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant