Commit Graph
1021 Commits
Author SHA1 Message Date
Coff0xc 2a9743eb9e fix(agent): reject unsafe ChatAgent session ids
Chat joined sessionID into <workDir>/sessions with no allow-list, so
".." or a separator would escape that directory. Production callers
use conv-<id>, but the exported method accepted any string.

Accept only [A-Za-z0-9_-] up to 64 bytes, then confirm the cleaned
path still sits under sessions/.
2026-11-18 22:40:21 +01:00
BaaRai 48d6158ac2 Merge pull request #341 from Coff0xc/fix/asset-http-href
fix(web): only http(s) asset URLs become service hrefs
2026-11-18 22:40:05 +01:00
Coff0xc d1431cfdcd fix(web): only http(s) asset URLs become service hrefs
The Services tab wrote the stored asset URL into href with no scheme
check. A javascript: or data: value stored via insert_assets or the
asset API became a clickable link. Non-http(s) URLs now render as text.
2026-11-18 22:39:38 +01:00
BaaRai 3bbda778e6 Merge pull request #340 from Coff0xc/fix/csv-formula
fix(report): neutralize formula cells in findings CSV export
2026-11-18 22:39:19 +01:00
Coff0xc fde809dd0c fix(report): neutralize formula cells in findings CSV export
FindingsCSV wrote name, class, summary, and task text as-is. A value
starting with =, +, -, @, tab, or CR is evaluated as a formula when
the file is opened in Excel or LibreOffice. Those cells are now
prefixed with a single quote.
2026-11-18 17:06:00 +00:00
BaaRai d89cf781b7 Merge pull request #337 from Coff0xc/fix/ask-operator-image-path
fix(server): confine ask_operator image_path to the task directory
2026-11-18 17:32:46 +01:00
BaaRai b4b4ade5b4 Merge pull request #336 from Coff0xc/fix/insert-assets-fail-closed
fix(agent): refuse insert_assets when intercept rules cannot be loaded
2026-11-18 17:32:29 +01:00
BaaRai 92254a2835 Merge pull request #334 from Coff0xc/fix/blobrange-overflow
fix(traffic): bound BlobRange without overflowing int64
2026-11-18 17:32:13 +01:00
Coff0xc 203103360e fix(server): confine ask_operator image_path to the task directory
image_path was opened as a raw filesystem path, so any readable
png/jpg/jpeg/webp/gif on the host could be copied into the operator
transcript. The path is now resolved from the task working directory
and refused when it contains .. or EvalSymlinks outside that tree.
2026-11-18 17:22:42 +01:00
Coff0xc 20b278cf98 fix(agent): refuse insert_assets when intercept rules cannot be loaded
insert_assets swallowed ListAssetInterceptRules and
TaskInterceptRulesSplit errors and evaluated an empty rule set, which
allowed every asset. A load failure now refuses the whole call. The
tool result is generic; the driver error stays in the process log.
2026-11-18 17:22:36 +01:00
Coff0xc 74c9c17626 fix(traffic): bound BlobRange without overflowing int64
offset+length > size wraps when length is near MaxInt64, so the cap is
skipped and make([]byte, length) can exhaust memory. Compare length
against size-offset instead.
2026-11-18 17:22:13 +01:00
BaaRai b6b9284d3a Merge pull request #333 from Coff0xc/fix/pg-text-array-escape
fix(db): escape backslashes in PostgreSQL text[] literals
2026-11-18 17:22:04 +01:00
Coff0xc 7681bacb50 fix(db): escape backslashes in PostgreSQL text[] literals
marshalStringArray quoted double quotes but not backslashes. In a
Postgres array element a backslash escapes the following quote, so a
value such as x\",evil,\"y could close the current element and inject
another. Double backslashes first, matching marshalJSONBArray.
2026-11-18 17:09:04 +01:00
BaaRai 04964ac9c9 Merge pull request #332 from Coff0xc/fix/mcp-null-env
fix(mcp): keep MCP env a writable map when JSON is null
2026-11-18 17:08:06 +01:00
BaaRai 9b8ddf0610 Merge pull request #338 from Dev-next-gen/fix/llmpool-trimerr-utf8
fix(llmpool): keep trimmed provider errors on a rune boundary
2026-11-18 17:07:57 +01:00
Leo Camus 864a60d48b fix(llmpool): keep trimmed provider errors on a rune boundary
trimErr cut the error text at byte 300, which can split a multi-byte
character. The result is stored as llm_profile_health.last_error, and
PostgreSQL rejects the invalid UTF-8, so the breaker state of a profile
whose provider answers in Chinese is never persisted and the write is
retried every second.
2026-11-18 13:07:45 +00:00
Coff0xc 230a99c2b9 fix(mcp): keep MCP env a writable map when JSON is null
json.Unmarshal of JSON null into a map yields nil. syncBrowserMCPProxy
then assigned NODE_EXTRA_CA_CERTS under traffic capture and panicked,
including during NewManager on every restart once that row was stored.
2026-11-18 11:43:40 +00:00
BaaRai 230ba39dd5 Merge pull request #324 from cyberd4ch/docs/317-scope-distance-trusted-input
docs(security): document scope_distance as a trusted input
2026-11-18 12:26:26 +01:00
BaaRai 9767a70205 docs(security): name the real ingest counters and block rules
in_scope_not_asset counts in-scope events that are not asset types, not
gate rejects: a rejected candidate comes back as an insertion forbidden
error in the insert_assets result. EvaluateAssetGate also applies block
rules whether or not an allow-list exists, so the no-allow-list gap is
about the allow rule, not the whole gate.
2026-11-18 12:12:50 +01:00
BaaRai 366e14066f Merge pull request #322 from Dev-next-gen/fix/finding-filename-utf8
fix(report): keep finding zip names on a rune boundary
2026-11-18 12:12:23 +01:00
BaaRai 4c486e1c01 Merge pull request #328 from Michael-JRead/fix/surface-provider-refusals
fix: report provider refusals, do not rerun them as idle turns
2026-11-18 12:12:19 +01:00
Mike ReadandClaude Opus 5.5 03e216d032 fix: report provider refusals, do not rerun them as idle turns
A turn the provider's safety system declines (Anthropic stop_reason
"refusal", OpenAI-compatible finish_reason "content_filter") has no text
and no tool calls. Norma passes the stop reason through and the harness
ends any tool-less turn with ReasonCompleted, so the run summary said the
model "ended this turn normally", and steerHooks.Stop took the empty turn
for an idle one and resent the conversation up to the empty-response retry
count.

The LLM recorder is the one layer that sees the stop reason. It now hands
each completed call's stop reason to an optional context sink
(llmrec.WithStopSink). captureRunSession installs a per-run tracker
(agent.WithStopTracker) on that sink. With it:

- steerHooks.Stop does not inject the idle-turn rerun after a refusal;
- terminalText reports "provider refusal (stop_reason ...)" and says the
  intent was not completed, instead of the completed wording.

Other terminal states and ordinary empty turns are unchanged.

Fixes #327

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 00:41:18 -06:00
dach-a 94be0148ce docs(security): document scope_distance as a trusted input
States the trust boundary discussed in #317:

- output.json's scope_distance is the integrated scanner's own verdict
  and is ingested as-is; in-scope events are not re-checked against
  ARTEX's rule set.
- The enforced boundary is the task allow-list: assets reach the graph
  (insert_assets) only through EvaluateAssetGate, and rejects are
  recorded as in_scope_not_asset.
- The no-allow-list case is an accepted gap, with operator guidance:
  configure an allow-list per task or review output.json before feeding
  it to ARTEX. Cross-checking ingested events against ARTEX's rule set
  would redefine existing scanner configurations, so it is a deliberate
  design question, not an accepted vulnerability.

Option 2 as picked on #317; documentation only.
2026-11-18 03:15:57 +00:00
Leo Camus 88aefa0fc3 fix(report): keep finding zip names on a rune boundary
FindingFilename cut the name at 120 bytes, which can split a multi-byte
character. archive/zip only sets the UTF-8 flag on valid names, so the
entry was written without it and unzip tools decoded the whole name as
CP437, garbling every non-ASCII character in it.
2026-11-18 02:37:26 +00:00
BaaRai 51e2c603b9 Merge pull request #282 from renaesop/codex/fix-record-fact-input-contract
fix: repair record_fact summary contracts and asset aliases
2026-11-18 03:30:48 +01:00
BaaRai 9355d83eea Merge pull request #314 from yeting1107/docs/post-0-6-0-changelog
docs: record the post-0.6.0 changes
2026-11-18 03:03:44 +01:00
BaaRai 9b850a090c docs: add the post-#305 changelog entries
The rebase onto current main keeps the original entries and adds the three
user-facing changes merged after its base: the finding report_state field,
the ordered LLM health persistence, and the framed intent summaries.
2026-11-18 02:52:25 +01:00
yeting1107 398a08814a docs: record the post-0.6.0 changes 2026-11-18 02:52:06 +01:00
Chubboy Ren c833130c28 fix: enforce exact record_fact fields and validate asset anchors 2026-11-18 01:51:41 +00:00
Chubboy Ren c0c568b31f Merge remote-tracking branch 'upstream/main' into codex/fix-record-fact-input-contract 2026-11-18 01:34:26 +00:00
BaaRai ac5e714eb6 Merge pull request #313 from BaaRai/fix/task-llm-health-badge
fix(llm): record breaker health on every task path
2026-11-18 01:42:49 +01:00
BaaRai 6568a8eb44 fix(llm): record breaker health on every task LLM path
The /system/llm/ badge read llm_profile_health, which only the failover
Pool wrote. A task pinned to an explicit chain, a bound agent with
failover off, and the global provider all call the provider directly, so
a dead backend stayed "Healthy".

One policy now lives in llmpool.Registry.RecordCall, used by the Pool and
by the task runtimes: a success clears the state, a failover-eligible
failure trips it, context cancellation and deterministic 400s do not, and
a stream that already delivered output is left alone. The selection
carries the profile whose breaker the call updates, and a provider
already wrapped in the Pool reports nothing to avoid double counting.

The LLM recording page also explains an empty list while the llm_record
toggle is off, after the settings call resolves.

Originally reported in #257.
2026-11-18 01:31:18 +01:00
BaaRai 9a2a9e61ef Merge pull request #308 from Coff0xc/feat/finding-report-state
feat(findings): report stage separate from triage status
2026-11-18 00:17:48 +01:00
Coff0xc 6a0b79d34f feat(findings): add report_state separate from triage 2026-11-18 00:07:50 +01:00
BaaRai 729f935a21 Merge pull request #311 from BaaRai/fix/agent-frame-intent-summaries
fix(agent): frame intent summaries as data (issue #124)
2026-11-17 23:55:50 +01:00
BaaRai 9777163bbf fix(agent): frame intent summaries as data
The wake lines interpolated a planner-written intent summary into the trusted sentence, and the overview kept every summary in the plain JSON, so an inherited summary crossed tasks as if this planner had written it (#124, F3). Frame the summary on the wake lines and move the open/running/recent-done summaries into one framed block; the structured intent fields stay plain.
2026-11-17 23:44:36 +01:00
BaaRai e80a33c098 Merge pull request #301 from Protonmatter/protonmatter/session-epoch
Reject sessions issued before a password change
2026-11-17 23:28:24 +01:00
protonmatter 95bd9c24f0 Merge commit 'eddf03ce61f0a506fede039ea8936709b84ade8e' into protonmatter/session-epoch
# Conflicts:
#	CHANGELOG.md
2026-11-17 16:56:29 -05:00
protonmatter 134562c3d9 Drop the unused database import and align the password constants. 2026-11-17 22:54:16 +01:00
protonmatter 7cac9c240b Retry the password version on login when startup could not read it. 2026-11-17 22:54:16 +01:00
protonmatter ebc54b8751 Bind sessions to a password version so revocation cannot tie inside one second.
The hash and version commit together, a failed read rejects tokens, and the reset script tells the operator to restart.
2026-11-17 22:54:16 +01:00
protonmatter 26a7bbec37 Reject sessions issued before a password change.
A failed password read no longer mints a setup token, and filling the login limiter no longer drops an active lockout.
2026-11-17 22:54:16 +01:00
BaaRai eddf03ce61 Merge pull request #304 from Protonmatter/protonmatter/llmpool-health-queue
Coalesce circuit-breaker health writes
2026-11-17 22:52:27 +01:00
BaaRai 9bc5856565 Merge pull request #302 from Protonmatter/protonmatter/budget-restore
Restore task spend from the lanes the live ledger counts
2026-11-17 22:52:23 +01:00
protonmatter c9d81a453f Align the Server literal so gofmt accepts it. 2026-11-17 22:39:53 +01:00
protonmatter b2a2f95e8c Release the circuit-breaker queue lock around the database write. 2026-11-17 22:39:53 +01:00
protonmatter 1fbf2263a1 Keep circuit-breaker writes in state order and flush them before the database closes.
A later update can no longer be queued behind an older one, a failed save is retried, and shutdown waits for the last cooling window.
2026-11-17 22:39:53 +01:00
protonmatter 847e32407a Coalesce circuit-breaker writes onto one queue.
A newer state for the same profile replaces one that has not been written yet, and a failed write is logged instead of discarded on a detached goroutine.
2026-11-17 22:39:50 +01:00
BaaRai 7bd9bf6e3e Merge pull request #309 from BaaRai/feat/traffic-rewrite-p33b1
feat(traffic): apply rewrite rules in the capture proxy (P3.3b1)
2026-11-17 22:38:59 +01:00
BaaRai f8bc3b3b6d Merge pull request #305 from Protonmatter/protonmatter/json-body-cap
Cap JSON request bodies
2026-11-17 22:29:08 +01:00