ARTEX: The Pentest Agent That Remembers How It Got There
Two graphs, a proxy that records every request, and a binary that can replace itself. Inside the Go and PostgreSQL architecture behind an autonomous security agent, and the approval gate its makers built to keep a human in the loop.
- ARTEX treats autonomous pentesting as a provenance problem: every finding is a node in a per-task exploration graph, anchored to an asset in a persistent graph.
- A task in ARTEX is a contract with a goal, a scope, timeouts, and a planner heartbeat that turns agent silence into a detectable state.
- The engineering details (advisory locks pinned to a dedicated connection, exit code 75, per-package test databases) are the evidence that the provenance model is trustworthy.
- A tool built to make autonomous offensive behavior traceable was released without a stated authorization policy, and that gap is the test its architecture did not pass.
A finding is not a line in a log
The agent has been working for eleven minutes. It enumerated subdomains of a target domain, probed the ones that resolved, and found a staging host that answers on port 80. It fetched the landing page, followed a link, and landed on an administrative panel at /admin. It tried two credential pairs. The second pair worked. The agent records a finding: an admin panel exposed at /admin, reachable with default credentials.
In most agent tooling, that finding is a line in an output stream. You get the result, and if you want the reasoning, you scroll up through a conversation transcript and reconstruct what happened by hand. In ARTEX it is a node. And the node has parents.
One hop back is the tool call that produced it. Two hops back is the enumeration that produced the input to that tool call. The finding sits at the end of a chain that starts at a stated goal and runs through every step that got there. ARTEX is built so an operator can ask "how did the agent know that?" and get an answer that is not a chat log. That single design choice is the difference between a tool you watch and a tool you can audit.
Two graphs, one anchor
The core of ARTEX is a split between two graphs that most agent projects keep as one blob. The first is a persistent asset graph. It records what the system knows about the target: typed nodes for root_domain, ip, subdomain, app, service, and endpoint, grouped into companies. This graph survives across tasks. It is the accumulated map of the environment.
The second is a per-task exploration graph. It records how the agent found out: a goal, the tool calls it made, the results those calls returned, and the findings it recorded. This graph is scoped to one task and one chain of reasoning. It is the provenance record.
The two are joined by asset anchors. A finding node in an exploration graph points at an asset node in the asset graph. The finding is not "this endpoint is vulnerable." It is "this endpoint is vulnerable, discovered by this chain of tool calls, in this task, against this scoped company." Two graphs, one thread between them.
This is unusual. Most agent tools collapse everything into a single state object or a conversation transcript, which means "what we know" and "how we found out" are the same data structure. Splitting them is what makes coverage views and provenance chains possible at all. Once findings point at assets, you can ask the reverse question too: for this endpoint, which tasks have touched it, and what did they conclude?
Read the diagram from the bottom up. A finding in the left panel is not self-contained. Click it and the chain above it lights: the goal, the enumeration, the probe, the result. Follow the thread to the right and you arrive at the endpoint it describes. The asset graph does not know how the agent found anything. The exploration graph does not know what else exists. The anchor is the only thing that tells both halves about each other.
That separation is also what makes the model scale. A new task starts fresh on the exploration side but reads from the same asset graph every previous task has been filling. Reconnaissance done once is not repeated. Coverage is visible. And every finding carries its own receipt.
What ARTEX actually is
The system behind that model is a Go backend with a Next.js frontend statically exported and embedded under a build tag, so the binary ships with its own UI. PostgreSQL is the store. Anthropic and OpenAI sit behind a provider abstraction with retry logic and health tracking, so a failed provider call is a tracked state rather than a crash.
- Backend: Go (roughly 3.6 MB of source by byte count), using pgx/v5 through its database/sql adapter.
- Frontend: TypeScript (roughly 2.1 MB) on Next.js with shadcn/ui, embedded at build time.
- Database: PostgreSQL, with PL/pgSQL triggers, GIN and GIST indexes, arrays, JSONB arrays, and CIDR columns.
- Traffic capture: a proxy on 127.0.0.1:8788, plus a browser extension that can push authenticated traffic via POST /api/traffic/ingest.
- Self-update: the binary can replace itself from the web UI, supervised by a shell start script that relaunches it on a specific exit code.
The README's own one-line description is blunt about the shape of the thing. It is a Chinese-language project, and the description names the two halves directly.
AI 自主渗透测试系统(Go 后端 + Next.js 前端)
Translated: an AI autonomous penetration testing system, Go backend plus Next.js frontend. A note on provenance, because it matters for everything that follows. The repository named in the brief for this article is Mohitsharma-2007/ARTEX, one of several instances of this project. The architecture described here is documented against the upstream project, Autumn-27/ARTEX, which is the source of the code and the README text quoted above. Where a claim is only verifiable against upstream, this article attributes it to upstream in the sentence itself. The two repositories are not asserted to share an author.
A task is a contract
A task in ARTEX is not a prompt. It is a contract. Each task pairs one-to-one with an exploration, and it carries a goal, a scope, timeouts, and a planner heartbeat. The goal is what the agent is trying to accomplish. The scope is what it is allowed to touch. The timeouts bound how long any phase may run.
The planner heartbeat is the quiet one, and it is the most interesting. An agent that goes quiet is a failure mode. It may be thinking, it may be stuck, it may be dead. Without a heartbeat, all three look identical from the outside, and the only signal is that nothing is happening. The heartbeat turns silence into a detectable state. A missed beat is information, not a hang.
There is a related detail in the entry point that tells you how seriously the team treats diagnosis. The process's shutdown context is deliberately detached from the signal context. If the parent's plain context.Canceled wins the race, every running agent loses the reason it stopped. The fix uses context.WithCancelCause, so each agent records why it was aborted rather than just that it was. In a system built around provenance, "why did this stop" is not a nice-to-have. It belongs in the record.
The same logic runs through the task lifecycle. A task that times out, a task that is cancelled, a task that loses its planner: each is a distinct terminal state with a distinct cause attached. The provenance model is only as good as the reasons it stores.
The human in the loop
The dual graph makes the agent legible. Intercept rules make it stoppable. Tool calls can be gated: before the agent runs a given action, the call is held as a pending item that an operator approves or rejects. A chat channel supports handoff, so the operator can step in mid-task rather than only at the end. This is the second half of the safety architecture, and it is explicit in the design rather than bolted on.
There is an honest gap here. The upstream README states a use restriction, but it does not state an authorization policy or acceptable-use terms in the operational sense: who may point this at what, under whose authority, with what evidence of consent. For a tool of this class, that omission is conspicuous. The approval gate keeps a human in the loop during a task. It does not establish that the human was authorized to start one.
The engineering is the tell
It is tempting to read a project like this through its feature list. The more revealing read is through its correctness details. A team that handles the subtle failure modes of a Go and PostgreSQL backend is a team that thinks about the provenance model at the same level, and the two are connected. You cannot trust a chain of reasoning from a system that silently drops its own state.
Start with schema application. schema.sql is embedded into the binary with go:embed and re-applied idempotently on every startup. That re-application happens under a session-level advisory lock, and the lock is held on a dedicated connection. The comment in the code explains why: running pg_advisory_lock through a pooled *sql.DB is wrong, because a later call may land on a different pooled session and the unlock silently misses. It is a bug class that many Go and PostgreSQL projects never notice they have.
// withSchemaMigrationLock takes a dedicated *sql.Conn and holds the
// session-level advisory lock on that connection.
//
// Running pg_advisory_lock through *sql.DB is incorrect: a later call may
// land on a different pooled session, so the unlock silently misses.
func withSchemaMigrationLock(ctx context.Context, db *sql.DB, fn func(*sql.Conn) error) error {
conn, err := db.Conn(ctx)
if err != nil {
return err
}
defer conn.Close()
if _, err := conn.ExecContext(ctx,
"SELECT pg_advisory_lock($1)", schemaMigrationLockKey); err != nil {
return err
}
defer conn.ExecContext(context.Background(),
"SELECT pg_advisory_unlock($1)", schemaMigrationLockKey)
return fn(conn)
}
The same care shows up in the pool cap. The maximum open connections is set to 32, and the comment documents the reasoning on both sides. It sits below PostgreSQL's default of 100, so the application cannot exhaust the server. It sits above the application's own nested checkout depth, because seeding built-in skills checks out a second connection while the schema lock is held. A cap that was too small would deadlock the process against itself. Without a cap at all, peak load produces FATAL: sorry, too many clients already. The chosen number is a deliberate point between two failure modes.
Then there is the schema's own defensive work. assets.ip is free text, and an agent or an API may write a hostname into it. A single bad row would otherwise break an entire company-attribution recompute. The fix is a small PL/pgSQL helper that wraps the cast in an exception block and returns null on failure, so one malformed value cannot take down the query. The comment also records why the team avoided pg_input_is_valid: it requires PostgreSQL 16, and they wanted compatibility with older installations. Even the error handling carries a documented tradeoff.
There is also the mundane kind of rigor that only comes from being burned. Each Go test package gets its own database, suffixed from the base name, because parallel test binaries contending on the same tables produced a family of deadlocks. The exit code protocol is the same story: the binary returns 75 to tell the shell supervisor to relaunch it, and 0 to stop. Running the binary directly breaks in-page updates, which is why the supervisor is a required part of the architecture rather than a convenience. None of this is glamorous. All of it is the reason the provenance model can be believed.
How it compares
ARTEX is not competing on what it can find. It is competing on what it can prove about how it found it. Placed against the tools an operator would actually consider, the difference shows up in the state model and the provenance column, not the feature list.
| Project | Core model | State | Provenance | Human in the loop |
|---|---|---|---|---|
| ARTEX | LLM agent over a persistent asset graph | PostgreSQL, cross-session | Per-task exploration graph with asset anchors | Configurable intercept rules and approval queue |
| PentestGPT | LLM-assisted reasoning assistant | Session / conversation | Conversation transcript | Interactive by design |
| Nuclei | Template-driven scanner | Stateless per run | None beyond run output | Operator reviews findings |
| Metasploit | Module-based exploitation framework | Session and workspace | Console log | Operator-driven throughout |
Nuclei is deterministic and template-driven, which is a strength: the same template produces the same check, and reproducibility is built into the format. Metasploit is module-centric and mature, with an ecosystem that has been hardened over years. PentestGPT is closer to a reasoning assistant, useful for guiding a human through a problem. None of them ship a provenance graph as the primary data structure, and that is the specific intersection ARTEX occupies: an agent runtime, a persistent security state, and an operator workbench in one binary.
One column is deliberately absent. Star counts and fork counts are time-sensitive and, given the repository ambiguity noted earlier, misleading here. The more honest scale signal is distribution status, and there ARTEX is the outlier: its upstream distribution was discontinued, per secondary reporting. That fact belongs to the next section.
The uncomfortable question
Secondary reporting describes reported misuse of the upstream project and says the maker stopped public versions and support afterward. The reporting distinguishes attempts and follow-on activity from confirmed data theft, and this article does not assert data theft. It also does not assert that the repository named in the brief shares this history; that link is unverified. What is verifiable is the shape of the outcome: a tool designed to make autonomous offensive behavior traceable left its makers' hands and became hard to govern.
That is the test the architecture did not pass. The dual graph solves the problem of reconstructing how an agent reached a finding. The intercept gate solves the problem of stopping a running agent. Neither solves the problem of who is allowed to run it, against what, with whose consent. The README states a use restriction, but a restriction is a request, not a control. There is no stated authorization policy in the operational sense, and for a system that automates reconnaissance and credential testing, that is the gap that matters most.
The honest reading is not that the team was careless. The engineering suggests the opposite. It is that they solved the safety problem they could see from inside the architecture and missed the one that lives outside it. Traceability is a property of the system. Authorization is a property of the relationship between the system and the world. You can build the first with advisory locks and anchor points. The second needs something the code cannot supply.
The question ARTEX leaves open is the one every agent project will eventually face. An agent that can act is only as safe as the chain of accountability behind it, and that chain runs through people and policies, not through graphs. ARTEX made the agent's reasoning legible and its actions stoppable. It did not make its use accountable, and no architecture can do that alone.





