# ARTEX
AI Autonomous Penetration Testing System (Go Backend + Next.js Frontend)
[简体中文](README.md) | **English**
---
> **ChainReactors Open Source Guardian Program**: Free CYBER AI security testing credits worth ¥30,000/month (3 months complimentary) for open-source infrastructure projects, with hands-on remediation assistance from our security team — zero-barrier support for the open-source community.
> Link: [chainreactors.ai/guardian](https://www.chainreactors.ai/guardian/)
## Screenshots
> Try the full interactive UI in the [Live Demo](https://artex-demo-ruoji6.vercel.app/).
| Dashboard (Overview / Token Usage / Activity Stream) | Task List |
| :---: | :---: |
|  |  |
| Task Execution (Sessions / Tool Calls) | Exploration Graph |
| :---: | :---: |
|  |  |
| Findings | Assets |
| :---: | :---: |
|  |  |
| Asset Coverage Graph (Force-Directed · Tested Highlight · Collapse/Expand) |
| :---: |
|  |
| Traffic Recording | Human-in-the-Loop Chat |
| :---: | :---: |
|  |  |
| Agent Management | LLM Configuration |
| :---: | :---: |
|  |  |
| Intercept Approvals | Backend Logs |
| :---: | :---: |
|  |  |
---
## Approval Record Details
Global **Approval Records**, per-task **Intercept Approvals**, and inline approval cards in chat all support expanding full call details. The layout draws inspiration from [AegisHook's CallDetail component](https://github.com/RuoJi6/AegisHook/blob/main/web/src/components/CallDetail.vue) while adopting ARTEX's native UI components and theme.
## Asset Sync (ScopeSentry)
Import asset inventories directly from [ScopeSentry](https://github.com/Autumn-27/ScopeSentry) to avoid duplicate reconnaissance:
- Enter your ScopeSentry URL and API Key on the **Asset Sync** page to connect the data source;
- Select targets and asset types (domains / subdomains / IPs / ports / sites / endpoints…) by **project** or **task**;
- Import in one click and merge into company asset scopes, feeding directly into ARTEX's Asset Graph for agents to explore.
---
## Deploying Your Own Online Demo (Auto-Updated on Releases)
The demo runs only the `web/` frontend built with `NEXT_PUBLIC_MOCK=1`—no Go, PostgreSQL, or LLM keys required. The interface uses mock data and performs no real scanning.
Release pipeline: official release packages, `SHA256SUMS`, and Docker images succeed → the `demo` job in `release.yml` calls `demo.yml` → checks out the tagged commit → builds the mock frontend → deploys to a fixed Vercel production domain. Ordinary `main` pushes, tag-only pushes, failed releases, drafts, and pre-releases do not update the demo. Maintainers still need to keep demo fixtures in `web/src/lib/mock/` up to date for new features.
### Initial Vercel Setup
1. Create an empty project in your Vercel account (e.g. `artex-demo-ruoji6`). Leave **Git disconnected** to avoid deploying on every commit; `web/vercel.json` also disables automatic Git deployments.
2. Under **Settings → Build and Deployment**, select **Next.js** and Node.js **22.x**, set Install Command to `npm ci`, Build Command to `npm run build`, and leave Output Directory at default. **Leave Root Directory empty**: the workflow invokes Vercel CLI from the checked-out `web/` directory and must not nest `web` twice.
3. Under **Environment Variables**, add `NEXT_PUBLIC_MOCK=1` for at least **Production**. Do not set `NEXT_EXPORT=1`, and do not configure database credentials or LLM keys.
4. Copy **Project ID** from **Settings → General**, and **Team ID** from team **Settings → General** (used as `VERCEL_ORG_ID`). Verify your production domain under **Domains**.
5. Create a deployment token in Vercel **Account Settings → Tokens** scoped to the project's team with an appropriate expiry, and store it in GitHub **Settings → Secrets and variables → Actions → Secrets** as `VERCEL_TOKEN`. Never commit tokens to the repository, README, or chat.
Add the following GitHub Actions **Variables** on the same settings page:
| Variable | Value |
| --- | --- |
| `VERCEL_ORG_ID` | Vercel Team ID |
| `VERCEL_PROJECT_ID` | Vercel Project ID |
| `DEMO_URL` | Fixed public production URL with `https://`, e.g. `https://artex-demo-ruoji6.vercel.app` |
### First Deployment & Retries
After merging the configuration into the default branch, open **Actions → deploy-demo → Run workflow**, choose branch `main`, and leave `tag` empty or enter the latest official release tag (e.g. `v0.3.21`). The workflow only accepts published stable releases containing all five platform archives and `SHA256SUMS`, and can also deploy historical releases created before this workflow existed—no need to recreate releases or move tags.
The workflow configures the dedicated demo project with framework Next.js, Node 22.x, empty root directory, `npm ci`, `npm run build`, `NEXT_PUBLIC_MOCK=1` in Production, and binds `DEMO_URL`. Use a dedicated Vercel project, as subsequent deployments maintain these settings.
After deployment succeeds, visit your production domain and verify `tag`, `commit`, and `mock: true` at `/demo-version.json`. Once confirmed, update the demo links in the README header and screenshots section to your production URL.
Subsequent stable releases will update the demo automatically. If a demo deployment fails, the published release archives and Docker images remain valid and the previous demo continues serving traffic; fix configuration and re-run `deploy-demo` without re-releasing. Concurrent releases serialize deployments and re-verify `latest` before building and going live so older builds cannot overwrite newer ones.
The release workflow directly calls `demo.yml` because releases created with `GITHUB_TOKEN` do not trigger downstream `release: published` workflows. `demo.yml` also listens to manually published releases via the GitHub UI with the same stability, completeness, and `latest` checks.
---
## Installation
> Requires **PostgreSQL**; autonomous exploration requires an **LLM** (`ANTHROPIC_API_KEY` or `OPENAI_API_KEY`, configurable via environment variables or the UI).
### Option 1: One-Click Install Script (Recommended)
```bash
git clone https://github.com/RuoJi6/ARTEX.git
cd ARTEX
./install.sh
```
The script supports Docker deployment and local compilation:
- **① Docker Deployment (Recommended)**: Uses `docker-compose.yml` (`postgres` + `docker-socket-proxy` + `artex` + `artex-gateway` TUN/netstack transparent gateway + dynamically spawned non-root `artex-sandbox` containers). Automatically populates `ARTEX_HOST_DATA_DIR`, `ARTEX_GATEWAY_TOKEN`, and a random `POSTGRES_PASSWORD`.
- **② Local Build**: Choose database (existing PostgreSQL or spin one up with Docker) → generate `config.json` → compile single binary with embedded frontend → start.
Non-interactive installation is also supported:
```bash
./install.sh --docker --yes
```
Once started, open **http://localhost:8787** (first visit redirects to `/setup` to set the administrator password).
### Option 2: Docker Compose (Manual)
```bash
git clone https://github.com/RuoJi6/ARTEX.git
cd ARTEX
cp .env.example .env # Set POSTGRES_PASSWORD, ARTEX_HOST_DATA_DIR, ARTEX_GATEWAY_TOKEN
docker compose up -d # Starts postgres + docker-socket-proxy + artex + artex-gateway
# → http://localhost:8787
```
All images support `linux/amd64` and `linux/arm64`: `ruoji6/artex: