Commit Graph
520 Commits
Author SHA1 Message Date
BaaRai b81c6238a7 feat: codeaudit skill (white-box source audit pipeline)
ARTEX hunts live targets well but has no methodology for auditing source
code handed to it (a plugin, an application, a repository). White-box
audits so far ran on ad-hoc task goals with no shared procedure.

Adds skills/codeaudit/SKILL.md, distilled from VulnHunter's methodology
(Apache-2.0) and adapted to ARTEX mechanics (work dir artifacts, facts,
report_finding, the standing quality and adversarial gates):

- production-code-only scope rules, with the checked-in infra-config
  exception (reverse proxy / trust / CORS directives are in scope)
- phase 1: every user-controllable input inventoried with dispositions,
  codebase partitioning, shared defense catalog
- phase 2: attacker-first forward tracing per vuln class, with the
  investigation discipline (never stop at abstraction boundaries, audit
  all parameters at outbound call sites, exhaust all paths, follow
  through stores and responses, transitive caller search on sinks)
- three gates (reachable, attacker-controlled, new capability), comment
  skepticism, sanitizer scope mismatch, anti-merge
- PoC preference order (executed against a local instance beats static
  trace; static PoCs carry entry value, file:line chain, sink literal,
  impact), measured impact per the standing gates
- sweep with per-instance dispositions and a count cross-check that
  forbids silent drops

Also fixes the shipped scopesentry skill, which the new guard test
caught immediately: its frontmatter block was never closed and its name
did not match its directory, so the whole file failed frontmatter
parsing and silently degraded to an empty description (the skill has
been undiscoverable). The new server test parses every shipped skill
with the real parser and fails on any skill LoadDir cannot read or that
ends with an empty description.
2026-10-12 06:41:22 +02:00
BaaRai b17f885935 Merge pull request #53 from BaaRai/feat/adversarial-verification-gate
feat: adversarial verification gate before confirmed findings
2026-10-12 06:31:28 +02:00
BaaRai b4430a3ef2 Merge pull request #51 from BaaRai/feat/finding-proof-and-measured-impact
feat: measured impact and attacker-goal proof standard for findings
2026-10-12 06:31:25 +02:00
BaaRai bb81979bf6 feat: adversarial verification gate before confirmed findings
The worker and pentest seeds already tell the agent to self-check
conclusions, but the check has no concrete axes and no rules for what
an elimination requires. In practice candidates get dropped on vibes
("probably validated downstream") or merged into one narrative finding,
and there is pressure to produce at least one finding per intent.

Changes, all in the default prompt seeds plus a guard test:

- worker and pentest seeds gain an "Adversarial gate before
  report_finding" block: actively try to disprove every candidate along
  five named axes (reachability, preconditions, downstream controls,
  scope, simpler explanation); eliminations need cited evidence at the
  same bar as confirmations; distinct entry points, parameters, or
  privilege levels are separate findings (anti-merge); zero confirmed
  findings is a valid outcome and precise negatives are real work.
- the retester seed now argues the opposite case before every verdict
  along the same five axes and must cite the specific requests,
  responses, or controls supporting reproduced / fixed / inconclusive
  alike; a prose assumption never substitutes for evidence.
- a seed test guards all markers against silent removal.

Methodology adapted from VulnHunter (Apache-2.0, adversarial
verification and anti-merge rules) and bug-bounty-hunting-prompts
(MIT, independent pre-confirmation disprove pass).
2026-10-12 06:26:51 +02:00
BaaRai 2d8e357961 feat: measured impact and attacker-goal proof standard for findings
Confirmed findings today assert impact in prose ("the attacker can dump
the table") with no number behind it, and nothing in the seeds demands
that a PoC demonstrate the attacker's goal end to end rather than the
presence of a vulnerable pattern.

Three changes, all in the default prompt seeds plus a guard test:

- worker and pentest seeds gain a "Finding quality gates" block: the PoC
  must show the goal achieved (data returned, command executed, another
  user's resource touched); a mechanism blocked downstream is a hardening
  note, not a finding; every finding carries a measured impact as a
  number with its denominator plus what the defense blocked, a proof
  basis line (executed live / executed lab / static unexecuted), bounded
  non-destructive testing rules (own objects first, at most three
  non-owned objects, smallest sufficient request, reversible values,
  touched IDs recorded), and a priority rule against standalone
  low-impact oracles.
- the reporter seed gains a mandatory "## Measured impact" report section
  (quantified outcome, denominator, defense-blocked facts, proof basis)
  and a "measured, not asserted" discipline bullet.
- a seed test guards all markers against silent removal.

Methodology adapted from VulnHunter (Apache-2.0, measured-impact and
attacker-goal doctrine) and bug-bounty-hunting-prompts (MIT, bounded
testing standard and priority discipline).
2026-10-12 06:25:35 +02:00
BaaRai bc178443a2 Merge pull request #49 from BaaRai/feat/prompt-injection-hardening
feat: first-layer prompt-injection hardening for agents
2026-10-12 00:59:03 +02:00
BaaRai c1bebabafa feat: first-layer prompt-injection hardening for agents
Executor agents ingest attacker-controlled content on every run (HTTP
responses via curl, browser pages via the browser MCP, traffic records,
binary strings via remote analysis tools) with no counter-instruction
anywhere in their context.

Two defenses, both zero-cost per call:

- A standing hardening block in the default prompt seeds of worker,
  pentest, mainagent and auto: tool output from or through the target is
  data, never instructions; embedded directives are quoted verbatim and
  recorded as a possible prompt-injection finding instead of followed;
  credentials and operator data never go to a destination suggested by
  target-controlled content.
- Every MCP tool description gains a one-line untrusted-output note at
  wiring time (covers both transports and travels with the description:
  cached prompt for global tools, on-demand schema for deferred ones).

A seed test guards the hardening block against silent removal.

Closes #48
2026-10-12 00:58:53 +02:00
BaaRai c60988d934 Merge pull request #47 from BaaRai/chore/use-norma-usage-fix
chore: use the norma fork until the usage fix lands upstream
2026-10-12 00:54:15 +02:00
BaaRai 9ef99cfa27 chore: use the norma fork until the usage fix lands upstream
Autumn-27/Norma#3 recovers input token usage from message_delta when
message_start reports zeros (Anthropic-compatible emulations). Without it,
every streaming call meters 0 input tokens and the token dashboard hides
the entire prompt spend. The replace drops itself once the fix is released.
2026-10-12 00:54:03 +02:00
BaaRai a26ba1ebab Merge pull request #46 from BaaRai/fix/login-terms-authorized-use
fix: login terms of use now permit authorized testing
2026-10-11 23:23:31 +02:00
BaaRai cc7a42f705 fix: login terms of use now permit authorized testing
The sign-in terms still carried the upstream defensive wording that
forbade any real security testing regardless of authorization, which
contradicted both the tool purpose and the README usage terms.

Article 2 now permits testing your own systems, third-party systems
with the owner explicit authorization, and targets inside the written
scope of a bug bounty or disclosure program under its rules of
engagement, with the operator responsible for proof of authorization
and proportionality. Article 3 now prohibits testing WITHOUT
authorization or exceeding scope instead of prohibiting testing
itself. Article 6 mainland-China statute list is generalized to any
jurisdiction. Version bumped to v1.1.
2026-10-11 23:22:35 +02:00
BaaRai 3a8a4f8366 Merge pull request #45 from BaaRai/feat/ask-operator
feat: ask_operator tool - workers can request operator input (captcha/OTP) with a screenshot and pause
2026-10-11 23:06:51 +02:00
BaaRai d54e468763 feat: ask_operator tool - workers can request operator input (captcha/OTP) with a screenshot and pause
A worker hitting a wall only a human can clear (captcha, email/SMS OTP, 2FA,
a decision) calls ask_operator with a precise question and an optional
screenshot. The question lands in the intent's transcript as a user-role turn
with an attachment card (the same {text, attachments} shape chat uploads use,
so the existing transcript UI renders it natively), and the intent pauses. The
operator replies through the existing message-to-worker flow; the reply resumes
the run with the answer as the next input. Images are whitelisted (png/jpg/
jpeg/webp/gif), capped at 10MB, and copied into the task uploads dir.

Closes #41
2026-10-11 23:06:39 +02:00
BaaRai 553a9ac638 Merge pull request #44 from BaaRai/feat/mcp-health
feat: surface MCP server connect health to operators and agents
2026-10-11 23:05:38 +02:00
BaaRai 7a98373cfd Merge pull request #43 from BaaRai/feat/backup-script
feat: built-in backup script (pg_dump with rotation, optional data archive)
2026-10-11 23:05:35 +02:00
BaaRai acce5cea2b Merge pull request #42 from BaaRai/feat/skill-frontmatter-safety
fix: emit safe skill frontmatter YAML and verify it round-trips
2026-10-11 23:05:32 +02:00
BaaRai 28e6618c71 feat: surface MCP server connect health to operators and agents
Every connect attempt (discovery, refresh, and the per-agent-run wiring) now
records its outcome on the server row: last_connect_at/ok/err, written through
a change-deduped update so per-run wiring does not amplify writes. The MCP page
shows a health chip per card (ok with time, or the failure reason), and a new
read-only mcp_status tool (bound to auto, worker and pentest) lets a worker
notice that a server it expected is down and say so instead of silently
degrading while the cached tool count keeps the card looking healthy.

Closes #38
2026-10-11 22:50:00 +02:00
BaaRai 2c8359fdb1 feat: built-in backup script (pg_dump with rotation, optional data archive)
scripts/backup.sh dumps the Postgres database through the postgres compose
service (no host psql needed) into timestamped gzip files under backups/,
keeping the newest N (default 14). --with-data additionally tars the
bind-mounted data directory and fails loudly when files written by the
container are unreadable instead of shipping a partial archive. README gains
a Backups section with the restore one-liner and a cron example.

Closes #40
2026-10-11 22:46:47 +02:00
BaaRai 07d272727d fix: emit safe skill frontmatter YAML and verify it round-trips
Descriptions written through the API were interpolated raw into the SKILL.md
frontmatter, so a value containing a colon+space made the whole frontmatter
unparseable: every field silently stayed empty, the skill loaded under its
directory name, and a skill-gated MCP server was silently skipped. The same
applied to updates through the meta rewrite, and the shipped scopesentry skill
had a malformed name line all along.

- yamlScalar: plain-safe tokens stay bare, everything else single-quoted
- fsCreateSkill/fsUpdateSkillMeta emit safe values and re-verify the written
  file with the real skill parser (name + mcps must survive), rejecting the
  write otherwise
- warnBrokenSkills at startup logs skills whose name fell back to the
  directory (the signature of broken frontmatter)
- fix skills/scopesentry/SKILL.md name line

Closes #39
2026-10-11 22:26:22 +02:00
BaaRai e2d7eecb61 feat: rea reverse-engineering skill + per-server MCP HTTP request timeout (#37)
feat: rea reverse-engineering skill + per-server MCP HTTP request timeout
2026-10-11 19:55:54 +02:00
BaaRai 799defadd1 fix: quote the rea skill description so the YAML frontmatter parses
A plain YAML scalar cannot contain a colon followed by a space; the unquoted
description had one, so yaml.Unmarshal failed and every frontmatter field
(including mcps) stayed empty. The skill then loaded with its directory name
but never gated its MCP server, and the server was silently skipped.
2026-10-11 19:09:08 +02:00
BaaRai 24c8ea13c0 feat: rea reverse-engineering skill + per-server MCP HTTP request timeout
Add a rea skill (skill-gated MCP): agents get binary and application package
reverse engineering through a rea MCP server, with tools kept deferred so the
172-tool catalog never bloats the prompt until the skill loads.

Remote MCP servers now take timeout_seconds (default 120): analysis servers
with minutes-long tool calls were cut off mid-call by the fixed 120s client
timeout. Applies to the Streamable HTTP transport; wired through discovery,
the ScopeSentry sync client, the API and the MCP dialog.

Closes #8
2026-10-11 19:02:23 +02:00
BaaRai b17fa7fe3a Merge pull request #36 from BaaRai/docs/prune-upstream
README: prune dead upstream links and fork-irrelevant sections
2026-10-11 17:23:53 +02:00
BaaRai e771e4f165 README: prune dead upstream links and fork-irrelevant sections
The original ARTEX repository no longer exists upstream, so both clone
URLs and both Releases links pointed at 404s: they now point at this
fork, which is the maintained source. The live demo lines and the
WeChat community group section (with its QR code screenshot) belonged
to the original author's channels and are removed. The References,
ScopeSentry, norma and AegisHook links stay (all alive, all
meaningful).
2026-10-11 17:23:46 +02:00
BaaRai 4ce99fb8bd Merge pull request #35 from BaaRai/docs/readme-coherence
README: make the license terms match reality, drop em dashes
2026-10-11 16:38:57 +02:00
BaaRai 4a901cb417 README: make the license terms match reality, drop em dashes
The repo is public now, so the header no longer says it is kept
private. The usage terms still described a learning-only toy, which
contradicted what the tool is; they now require explicit
authorization (own systems, labs, or bounty program scope) and drop
the mainland-China-specific law list for a general jurisdiction line.
All em dashes are replaced with standard punctuation.
2026-10-11 16:38:50 +02:00
BaaRai e827c62933 Merge pull request #34 from BaaRai/feat/traffic-ingest
Traffic ingest: capture operator browsing via a browser extension
2026-10-11 15:03:08 +02:00
BaaRai d8f47d4359 Traffic ingest: capture operator browsing via a browser extension
Closes #33. The MITM proxy only sees the agent's own actions, so
anything behind a human gate (signup captcha, email OTP, 2FA, SSO)
left the authenticated surface dark. The operator's browser becomes a
capture source instead:

- traffic: exported RecordExternal storing an externally captured
  exchange through the same spill/blob/FTS path as proxy traffic
  (insert logic shared with record()); rejects unparsable URLs and
  empty methods
- server: POST /api/traffic/ingest inside the authenticated API group,
  batch capped at 50 entries, bodies truncated at 256 KiB, per-entry
  ingested/failed counts
- extension/: Manifest V3 Chrome/Edge extension driving the
  chrome.debugger Network domain on the chosen tab, batching text
  exchanges to the ingest endpoint with the operator's URL + JWT in
  chrome.storage.local; binary bodies skipped; flush on batch/stop
- tests for both layers, README section
2026-10-11 14:53:08 +02:00
BaaRai 95a8206cb6 Merge pull request #30 from BaaRai/bot/fix-argjson
Bot: quote the response_format JSON for --argjson
2026-10-10 19:19:39 +02:00
BaaRai 0e82253686 Bot: quote the response_format JSON for --argjson
--argjson requires strict JSON; the unquoted-key object made jq fail,
sent an empty request body, and the triage died with 'model returned
nothing'. Also log the raw API response when choices is missing so the
next failure shows its cause immediately.
2026-10-10 19:19:34 +02:00
BaaRai 905e401676 Merge pull request #28 from BaaRai/bot/json-mode
Bot: JSON mode for triage, temperature 0, flash model
2026-10-10 19:16:42 +02:00
BaaRai 42f3bd98ea Bot: JSON mode for triage, temperature 0, flash model
The trailing-line LABELS contract was unreliable at temperature 0.2:
a raw A/B run showed both deepseek-chat and deepseek-flash emit the
line correctly at temperature 0 but drop it nondeterministically at
0.2 (five failed live runs, one lucky success). Structural fix: the
triage now requests response_format json_object, temperature 0, and
parses the reply with jq (comment field for the reply, labels array
for labeling). The label whitelist still drops invented names and the
raw JSON is logged before parsing. Model switched to deepseek-flash:
the A/B showed JSON compliance on both models and flash is the
cheaper line. Mentions and PR first-looks keep text mode at
temperature 0.
2026-10-10 19:16:37 +02:00
BaaRai cf68aece0a Merge pull request #26 from BaaRai/bot/restore-prompt
Bot: restore the original LABELS instruction wording
2026-10-10 19:08:06 +02:00
BaaRai f420277729 Bot: restore the original LABELS instruction wording
The reworded instruction from #20 ("plain text with no markdown
formatting, characters, or emphasis") made models stop emitting the
LABELS line entirely; the original quoted phrasing had 100 percent
compliance. Tolerant parser and debug logging stay.
2026-10-10 19:08:00 +02:00
BaaRai e39734539d Merge pull request #24 from BaaRai/bot/debug-tail
Bot: log the raw reply tail for triage debugging
2026-10-10 19:06:04 +02:00
BaaRai d1d28cb333 Bot: log the raw reply tail for triage debugging 2026-10-10 19:05:59 +02:00
BaaRai 631859657a Merge pull request #22 from BaaRai/bot/revert-flash
Bot: back to deepseek-chat
2026-10-10 19:02:19 +02:00
BaaRai 698ec389e0 Bot: back to deepseek-chat
deepseek-flash dropped the LABELS instruction twice in live tests
(decorated once, absent once); deepseek-chat followed it exactly on
the first try. The price difference is fractions of a cent per call,
reliability wins. The tolerant parser from #20 stays: it is harmless
and protects against any model formatting quirks.
2026-10-10 19:02:13 +02:00
BaaRai 919755dc2a Merge pull request #20 from BaaRai/bot/robust-labels
Bot: tolerate decorated LABELS lines from smaller models
2026-10-10 19:00:09 +02:00
BaaRai c08a229a57 Bot: tolerate decorated LABELS lines from smaller models
deepseek-flash sometimes bolds or backticks the LABELS marker and the
individual names. Accept any decoration around the marker line and
strip markdown characters from each name before the whitelist check.
Also log the parsed label line for easier triage of future misses.
2026-10-10 19:00:04 +02:00
BaaRai 0213310e38 Merge pull request #18 from BaaRai/bot/deepseek-flash
Bot: switch the model to deepseek-flash
2026-10-10 18:56:23 +02:00
BaaRai f95e975e31 Bot: switch the model to deepseek-flash
DeepSeek's current recommendation: V4.1-Flash replaces V4-Pro and is
the efficient line (new encoder-decoder MoE, quarter-size KV cache,
off-peak at half price). Plenty for triage work; the API name is
deepseek-flash.
2026-10-10 18:56:18 +02:00
BaaRai 765308712e Merge pull request #16 from BaaRai/bot/maintainer-labels
Bot: label maintainer-opened issues, silently
2026-10-10 18:46:37 +02:00
BaaRai 7511937e82 Bot: label maintainer-opened issues, silently
Closes #15. Issues opened by the maintainer now go through the same
classification and label application but without the triage comment
or reaction. Visitors keep the full behavior; mentions and PR
first-looks stay maintainer-off.
2026-10-10 18:46:31 +02:00
BaaRai e9527fa8f2 Merge pull request #14 from BaaRai/bot/triage-labels
Bot: apply type and priority labels when triaging new issues
2026-10-10 18:43:27 +02:00
BaaRai 875f2f0f53 Bot: apply type and priority labels when triaging new issues
Closes #13. The triage prompt now ends with a LABELS line (bug,
question, feature, plus P1/P2/P3 for bugs). The script strips that
line from the posted comment, filters it against a fixed whitelist,
creates the labels with stable colors if missing, and applies them.
Mentions and PR first-looks stay comment-only.
2026-10-10 18:43:21 +02:00
BaaRai 3eebf02596 Merge pull request #12 from BaaRai/bot/issue-pr-bot
Add triage and reply bot for issues and pull requests
2026-10-10 18:18:20 +02:00
BaaRai 815a12d91c Merge pull request #11 from BaaRai/ci/add-ci
Add CI: go build/vet/test with postgres, web typecheck and static build
2026-10-10 18:18:16 +02:00
BaaRai 525ad9ffde Skip the four known-broken tests in code instead of CI -skip flags
The go test -skip flag proved unreliable in the full-suite CI shape
(the same pattern skipped correctly in isolation but ran on the
runner), so each of the four tests now carries an explicit t.Skip with
the reason and a pointer to issue #9. The CI workflow drops the -skip
argument and keeps serial package execution.
2026-10-10 18:12:42 +02:00
BaaRai 78a2d2c01f ci: serialize test packages against the shared postgres
The rotating agent-package failures were cross-package database
interference: go test runs package binaries in parallel and they all
share the one postgres service, so fixtures delete each other's rows.
-p 1 makes package execution serial and the database deterministic.
2026-10-10 17:50:07 +02:00