49 Commits
Author SHA1 Message Date
BaaRai d234e341fc Budget docs: wrap-up is typical, not deterministic; [budget] logged per planner round only 2026-11-12 19:18:07 +01:00
BaaRai 4cde1a889f Budgets: revive clears the settle state, document config, allow update_finding_report in wrap-up
- resetSettledRun clears settling and the budget ledger; a done/failed task
  revived to running now plans and claims again (was gated by the old wrap-up).
  resetTimeoutRevival calls it. Test: TestResetSettledRunRestartsBudget.
- docker-compose.yml passes the four ARTEX_*_BUDGET_* variables through.
- .env.example and README document the variables, the wrap-up, the in-memory
  ledger and the practical floor.
- llmrec: the usage sink runs even without a PostgreSQL recorder; comment fixed.
- BudgetWrapupBlocks allows update_finding_report.
2026-11-12 18:48:41 +01:00
BaaRai d116517c64 Egress: return large unshared responses without an error, namespace the transport cache per client, pace WebFetch only 2026-11-12 16:44:08 +01:00
BaaRai 6a5adf73fe Docs: WebFetch results are coalesced, not cached 2026-11-12 16:33:22 +01:00
BaaRai 0b59f4670b Egress governor: noise profiles (off by default), per-host rate limit, dedupe and short cache
ARTEX_NOISE_PROFILE = off | quiet | balanced | aggressive drives one shared
governor used by WebFetch, the http custom tools and the enrich probe: token
bucket, bounded jitter and concurrency per host, a global cap, backoff on
429/503 honouring Retry-After with bounded retries, per-task coalescing and
a short cache of identical GETs (never POST/PUT/PATCH/DELETE), and a
per-host noise log line each minute. Off (the default) is a strict
passthrough.

Removes the fixed artex-enrich/1.0 User-Agent; ARTEX_TARGET_USER_AGENT sets
one under a profile (empty = unchanged).
2026-11-12 16:30:56 +01:00
BaaRai 8c3bae41f6 Untrusted boundary ON by default (opt-out via ARTEX_UNTRUSTED_BOUNDARY=0)
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).
2026-11-12 14:46:44 +01:00
BaaRai e59db80173 Opt-in update banner, off by default
ARTEX_UPDATE_CHECK=1 lets the backend check the public GitHub releases API
for the latest tag at most once per 24 h (in-memory cache; failures are not
retried in the window) and report it in GET /api/health when it is newer
than the build version. The web UI shows a dismissible strip linking to the
Releases page. Unset (the default), no update request is made.
2026-11-12 12:54:25 +01:00
BaaRai cab0a10c6f docs: openai-responses base URL suffix 2026-11-09 11:53:01 +01:00
BaaRai a7da0559f3 docs: Anthropic base URL must not end in /v1 2026-11-09 11:27:54 +01:00
BaaRai 9784bb192c chore: keep secrets out of the Docker build context; drop stale README step
The build stage of the Dockerfile runs `COPY . .`, so anything left in the
checkout root is sent to the builder and copied into the build stage. Exclude
the local secrets and backups that the install and backup scripts create
there: .env, config.json, jwt.key and backups/. keys/ was already excluded.

The Docker Compose (manual) section of the README still told users to build
the single binary before `docker compose up -d --build`. Since the
multi-stage Dockerfile builds the frontend and the Go binary itself, that
step is no longer needed; remove it.
2026-11-06 14:31:52 +01:00
BaaRai 4be2fc5c9a docs, ci: proxy setup for host and Docker, shellcheck reset-password.sh
- README: ARTEX_TRUSTED_PROXIES for nginx and ARTEX on the host
  (127.0.0.1) and for nginx on the host with ARTEX in Docker (the bridge
  gateway, found with docker network inspect).
- CI shell job: run shellcheck on reset-password.sh too.
2026-11-05 17:06:10 +01:00
BaaRai d0d153b768 fix(auth): trusted proxies for the login rate limit, 12 characters in reset-password.sh
- ARTEX_TRUSTED_PROXIES (comma-separated CIDRs, empty by default). When
  the TCP peer is listed, the login limit reads X-Forwarded-For from the
  right and keys on the first hop that is not a trusted proxy; otherwise
  the header is ignored. Without it every client behind a reverse proxy
  shares one bucket and an attacker can block the admin. Passed through
  by docker-compose.yml and listed in .env.example.
- README: nginx example sends X-Forwarded-For; document the variable;
  the binary's default listen address is 127.0.0.1:8787.
- reset-password.sh refuses passwords under 12 characters, counted in
  characters like the server.
2026-11-05 16:57:48 +01:00
BaaRai e6e9b2f978 Add Trendshift badge to README
Added a Trendshift badge to the README.
2026-11-04 21:29:45 +01:00
BaaRai 65bdc5d73c fix(auth): keep the JWT signing key in a dedicated volume
The server wrote jwt.key to the executable's directory, /app in the
image, so it lived in the container's writable layer and every container
rebuild generated a new key and signed all users out.

- ARTEX_JWT_KEY_DIR selects the key directory (default: config.BaseDir(),
  unchanged for non-Docker installs). docker-compose.yml sets it to
  /app/keys and bind-mounts ./keys there; the Dockerfile declares the
  volume. The key stays out of data/, which the file manager browses.
- loadOrCreateJWTKey creates the directory (0700). When keyDir/jwt.key is
  missing it migrates dataDir/jwt.key, then BaseDir()/jwt.key (mode 0600,
  old file removed), otherwise generates a new key. An existing key is
  never overwritten; a short one is now a startup error.
- .gitignore and .dockerignore exclude keys/.
- README and CHANGELOG updated; the 0.5.0 known issue is removed.
2026-11-04 09:18:11 +01:00
BaaRai 5bad722593 fix(auth): make the published bind address configurable
Publishing 127.0.0.1:8787 removed the only working access path for installs
reached through a host or WSL IP, without an obvious way back. Keep loopback as
the default and let ARTEX_BIND_ADDR override it (0.0.0.0 restores the old
behaviour; the setup token still protects the first-run claim).
2026-11-03 22:18:27 +01:00
GRAB Racem 2aab3e8210 fix(auth): require a setup token for /api/auth/init and bind 8787 to localhost
POST /api/auth/init accepted any caller while auth.password_hash was empty,
so whoever reached port 8787 first could set the admin password and take the
instance. When no password is set at startup, the server now generates a
random one-time setup token and writes it to the server log. authInit
compares it in constant time, rejects a missing or wrong token with 403, and
clears it once the password is stored.

The setup page has a field for the token and api.initPassword sends it.
docker-compose publishes 8787 on 127.0.0.1 only, like 8788. README says where
to find the token.
2026-11-03 22:18:27 +01:00
BaaRai 9ebc8b6703 docs: recovery note for clones made before the history rewrite 2026-11-02 17:07:32 +01:00
BaaRai 1ed154e86c fix: build the image locally instead of pulling a third-party namespace
docker-compose.yml referenced autumn27/artex:latest. That repository is gone
(404), but the Docker Hub account is alive, so whoever holds that name can
publish the tag and every compose pull would run their image. A local review
of the published artifacts found the same class of risk still present on the
default install path after #125 removed the in-app updater.

Build from the checkout instead, and make update.sh stop when git pull cannot
fast-forward: it used to warn, rebuild the old tree and print 'Build complete',
which is what every clone made before the 2026-10-23 history rewrite now hits.
2026-11-02 17:03:53 +01:00
Glauber Portella 80a1ee96f6 ollama llm 2026-10-23 18:12:38 -03:00
stevenAthompson 2d5f9677f4 chore: remove automatic update check and in-app self-update
The update source is hard-coded to a repository that no longer exists and the release checksums are unsigned. Removes the selfupdate package and the /api/update/* endpoints, the top-bar check that queried GitHub on every page load, the Version & Updates card, and the exit-75 swap protocol in the start scripts.
2026-10-22 23:58:37 -04: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 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 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 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 0aa837149d README: note this is a private English fork of Autumn-27's ARTEX 2026-10-08 23:22:05 +02:00
BaaRai e233c02314 Translate all Chinese text to English
Comments, doc comments, UI labels, log and error messages, LLM prompt
strings, markdown docs, test data and assertions. Identifiers, enum
keys, routes, placeholders and code structure are unchanged.

Notes:
- docs/漏洞流量证据.md renamed to docs/vulnerability-traffic-evidence.md
- tests that exercised CJK specific handling (GBK zip names, Chinese
  full text search) now use ASCII equivalents; go build passes and the
  test suite matches the pre translation baseline (remaining failures
  need a PostgreSQL DSN and fail identically on the original)
- frontend mention syntax now uses English kinds (finding, asset, ...)
  matching the backend, chat mentions tests pass
2026-10-08 23:14:34 +02:00
Autumn-27 6239c46c12 fix(web): SSE 活动流默认同源,修复反代部署连不上 :8787
sseUrl() 原先无条件把 SSE 地址拼成 ${hostname}:8787,连生产静态导出
也带这个硬编码。反代到 443 的部署里页面从 https://域名/ 加载,SSE 却被
指向 https://域名:8787/...,而 8787 未对公网开放,导致活动流连不上、反复重连。

改为用 NODE_ENV 区分:生产默认同源(相对路径),仅 next dev 保留 :8787
以绕过 Next.js /api 反代对 SSE 的缓冲。NEXT_PUBLIC_SSE_BASE 覆盖口保留。
验证:NEXT_EXPORT=1 next build 后生产包里 :8787 分支已被 tree-shake。

补充 README 反向代理部署文档(同源说明 + nginx 关缓冲配置)。

Closes #169
2026-10-02 20:10:08 -04:00
Autumn-27 b7d30f16c9 fix(intercept): 收紧裁判输出协议,减少 1024 截断导致的 fail-open
- 裁判 comment 上限 500→120 汉字,每段一句话、宁短勿长,合规裁决远低于
  MaxTokens=1024,基本消除截断(截断会致输出无法解析而按失败策略放行)。
- 硬化「只输出 JSON、不带思考/前言/代码块包裹」,减少非 JSON 前言吃掉 token
  预算。保留 实际操作/成功后的后果/命中规则 三段结构,与 ParseVerdict 一致。
- docs(readme): 精简审批详情/上下文模型审查一节。
2026-09-19 10:24:08 -04:00
Autumn-27 e6864abe4a docs: 采用 AGPL-3.0 开源协议 2026-09-18 07:47:13 -04:00
Autumn-27 df577842fd docs(readme): 完善许可与免责声明 2026-09-18 07:43:58 -04:00
RuoJi6 eee40408ee 精简动作审查输入并支持审批来源定位 (#125)
* fix: 精简审查背景并区分人工消息与调度输入

* fix: 模型审查仅提交当前调用与选定背景

* feat: 审批来源定位原会话并移除 Worker 审查背景
2026-09-15 23:51:37 +08:00
RuoJi6 d9628d7cc0 feat(intercept): 模型审查补充任务上下文与裁决说明 (#124)
审查模型改为接收版本化 JSON:任务描述/目标/操作约束、工作目录、Worker 意图、当前轮输入,以及按 tool_use_id 配对的近期工具执行记录;末尾是完整的 tool_name 与 arguments。

- 任务约束每次审查从数据库重新读取;读取失败或约束超预算转人工。
- 历史只保留唯一配对的执行事实,排除 Agent 自述、未完成请求与平台拒绝反馈。
- 裁决改为 JSON decision(allow/ask/deny) + comment,三种结果均须说明实际操作、成功后果与命中规则。
- 所有模型裁决(含自动放行)保存实际模型输入与 SHA-256 指纹,详情页可展开。
- 对话审批卡片支持展开完整请求、模型输入、裁决与执行结果。
- 修复父目录 lockfile 导致的 Turbopack 根目录误判。

官方默认拦截规则、工具范围与优先级不变。
2026-09-15 20:08:12 +08:00
RuoJi6 29d378416e feat: support legacy SSE MCP servers (#117) 2026-09-15 00:56:16 +08:00
Autumn-27 b42ec8aeed feat(update): 页面一键更新 + 守护启动脚本
系统配置页新增「版本与更新」卡片,顶栏版本号旁在有新版时亮出提示胶囊。
更新链路:下载发布包 → 比对 SHA256SUMS → -h 冒烟测试 → 暂存 artex.new
→ 以退出码 75 退出 → 守护脚本重新拉起并完成换装,页面轮询 /api/health
等版本号变化后自动刷新。

新增 start.sh / start.bat 作为正式启动入口,只按退出码决定是否重新拉起
(0 停止 / 75 应用新版 / 其余崩溃退避)。校验、冒烟、换装、回滚全部收在
selfupdate 包里而不写进脚本:这些逻辑在 sh 和 bat 上要写两套,而它们恰恰
最不能出错——换上跑不起来的二进制后守护进程会反复拉起它,只能上机器手工救。
Docker 的 ENTRYPOINT 一并改为该脚本,并由它转发 SIGTERM,否则 docker stop
只发给 PID 1,artex 做不了优雅关闭会被 SIGKILL 硬杀。

失败保护两道闸门互补:无法 exec 由换装前的冒烟挡住,能执行但初始化崩溃
由启动计数兜住(连续 3 次失败自动回滚 artex.old,坏的留作 artex.failed)。

GitHub 查询结果后端缓存 30 分钟(失败 2 分钟)。未认证 API 是每 IP 每小时
60 次,且这 60 次是服务器 IP 上所有用户共用的,顶栏每次整页加载都查一次,
不缓存会很快耗光配额导致真想更新时反而查不动。手动「检查更新」带 force=1
绕过缓存。

安全:只认 GitHub 域名且强制 HTTPS(逐跳校验重定向),发布源写死不可配置;
升级文件挂在可执行文件所在目录而非 CWD(服务化运行时 CWD 可能是 /);
开发构建版本号不可比较,禁用一键更新。

走完整 zip 而非裸二进制,因为现有 Release 的 SHA256SUMS 只覆盖 zip,
这样无需改 CI,也兼容已发布的历史版本。

已知限制:Docker 下只换程序不换镜像(工具链不同步、重建容器会退回镜像
版本);不同步发布包里的 skills/;更新即重启会中断运行中的任务。
2026-09-11 12:39:59 -04:00
Autumn-27 e237d3c9f3 Merge PR #103: feat: 支持会话级漏洞复测与运行状态展示 2026-09-10 10:02:39 -04:00
ji ruo 1c77195e79 feat: 支持会话级漏洞复测与运行状态展示 2026-09-10 16:06:08 +08:00
ji ruo 009799e160 feat(intercept): 增加审批记录详情与执行审计 2026-09-10 15:10:50 +08:00
Autumn-27 9b942ec4fb docs(readme): 增加微信公众号交流群二维码 2026-08-31 09:59:23 -04:00
pphua 5ef3d36887 fix(build): avoid UPX Linux startup crashes 2026-08-22 14:52:01 +08:00
pphua 72f6d697b3 build: add compressed cross-platform release artifacts 2026-08-22 13:33:34 +08:00
Autumn-27 46f2154657 docs: 新增 update.sh 更新脚本 + README 更新升级章节
- update.sh:对应 install.sh 的两种模式做升级(① Docker 拉新镜像重建 /
  ② 本地重编内嵌二进制),可选 git pull;DB 迁移靠启动幂等重跑 schema.sql
- README 新增「更新升级」一节(方式一~四),说明数据不丢 + 重启即迁移 + 建议先备份
2026-08-11 09:50:38 -04:00
Autumn-27andClaude Opus 4.8 c897869445 docs(readme): 增加资产覆盖图截图
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-09 01:33:23 -04:00
Autumn-27andClaude Opus 4.8 8c583c0ceb docs(readme): 新增系统技术架构章节 + Mermaid 架构图
- 双图架构(探索图+资产图)+ 锚点连接、总体分层图与组件表
- 引擎意图闭环时序图、worker 过程级信息交换图、planner 多轮共享
  todolist 稳定攻击链路图(5 张 Mermaid,GitHub 原生渲染,无 emoji)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-09 01:23:59 -04:00
Autumn 464f1898b4 Update README.md 2026-08-07 10:20:56 +08:00
Autumn 2ce2f8da79 add Cairn 2026-08-07 10:19:50 +08:00
Autumn-27andClaude Opus 4.8 35648937e3 README 增加了 ScopeSentry 资产同步说明
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-26 05:37:51 -04:00
Autumn-27andClaude Opus 4.8 b284df2d93 docs(readme): 增加 ScopeSentry 资产同步说明
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-26 05:34:46 -04:00
Autumn-27andClaude Opus 4.8 ee97991a5e docs: 重写 README(安装教程 + 12 张截图 + Demo 链接)
- README:清空旧内容,新增安装教程(脚本/Docker/Releases/源码)、配置、开发、
  截图预览 12 张、在线 Demo https://artex-demo.vercel.app/
- screenshots/:12 张页面预览
- fix(mock):activity/conversation 的 detail 端点返回真实内容(此前气泡显示占位文)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-26 05:16:43 -04:00
Autumn-27andClaude Opus 4.8 0ef8561411 chore: ARTEX 初始化
ARTEX — AI 自主渗透测试系统(Go 后端 + Next.js 前端,单二进制内嵌)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-26 04:27:45 -04:00