> your AI agent picks dependencies from memory; give it dated facts — try starlog.dev ↗ vet your agent's deps ↗ vibe-coding is fine. vibe-importing isn’t. — try starlog.dev ↗ vibe-importing isn’t fine ↗ your agent has never seen your private packages — try starlog.dev ↗ facts for private packages ↗ a linter for the dependencies your AI agent picks — try starlog.dev ↗ a linter for agent deps ↗ whois is redacted, cdns mask the rest — get the real operator — try whoisgeni.us ↗ who really runs that domain ↗ domain attribution that shows its work — full evidence chain — try whoisgeni.us ↗ domain intel w/ evidence ↗

← Back to Articles

CodeScan-Artex: Building a Code Audit Platform That Can't Accidentally Hack You

[ View on GitHub ]

CodeScan-Artex: Building a Code Audit Platform That Can't Accidentally Hack You

Hook

Most LLM-powered code audit tools can theoretically execute arbitrary commands or exfiltrate data through their agents. CodeScan-Artex takes the opposite approach: it physically removes those capabilities from the tool inventory before agents even start.

Context

Static application security testing (SAST) tools have a false positive problem. When Semgrep flags 847 potential SQL injections in your Spring Boot monolith, maybe 12 are real—the rest are framework-validated parameters, test fixtures, or code paths that can't be reached from external input. Security teams spend weeks triaging these findings, manually tracing data flows to determine which vulnerabilities matter. Meanwhile, software composition analysis (SCA) tools report every CVE affecting every dependency version you've imported, regardless of whether your code actually calls the vulnerable function. You get 200 critical alerts because Log4j 2.14.1 is in your classpath, even though you only use it for a startup banner that processes zero user input.

Large language models promised to solve this: just feed GPT-4 your entire codebase and ask "which SQL injections are exploitable?" Early experiments worked surprisingly well for small projects, but scaling hit immediate problems. How do you track which parts of a 500-file application the LLM has examined? How do you prevent duplicate findings when multiple reasoning sessions discover the same endpoint? How do you provide evidence chains defensible enough for compliance reports? And critically: how do you stop an LLM agent with filesystem access and Bash capabilities from accidentally (or maliciously) executing the very vulnerabilities it's supposed to find? CodeScan-Artex emerged from this constraint: build a multi-agent audit platform where agents literally cannot execute code or make network requests, not through sandboxing or monitoring, but by never giving them those tools in the first place.

Technical Insight

Knowledge Graphs

exploration_anchors

Task Creation

Graph Mutations

Trigger

Spawn Intents

Claim Work

Read-Only Access

Execute

Write Facts/Assets

Next Planning Cycle

Next.js Frontend

Embedded via go:embed

Go Backend

Task Orchestrator

PostgreSQL

Dual-Graph DB

Event-Driven Planner

Debounced

Frontier Queue

Parallelizable Intents

Worker Goroutines

Isolated Intent Dirs

Whitelisted Tools

7 FS + Asset Registration

Source Code

tasks/taskID/source

Exploration Graph

goals→intents→facts→findings

Asset Graph

apps/endpoints/CVEs

System architecture — auto-generated

The architecture is a three-layer orchestration system that separates planning, execution, and knowledge storage. At the core is a dual-graph database model that distinguishes between reasoning artifacts and ground truth. The exploration graph stores per-task lineage chains—goal nodes spawn intent nodes, which produce fact nodes and finding nodes—creating an audit trail of how conclusions were reached. Separately, the asset graph stores cross-task shared entities: applications, endpoints, CVEs. A junction table called exploration_anchors links these graphs, so you can query both forward ("which intents examined this endpoint?") and reverse ("which endpoints did this task cover?").

The security model is architecturally enforced through tool assembly whitelisting. When a worker goroutine starts processing an intent, it receives exactly seven filesystem tools—Read, Write, Edit, MultiEdit, LS, Glob, Grep—plus domain-specific registration functions like register_asset and register_finding. Here's the critical implementation detail: the tool inventory is constructed at worker initialization, not dynamically loaded:

// Worker initialization - tools are assembled once
func (w *Worker) initializeTools(intentDir string, sourceDir string) {
    w.tools = []Tool{
        NewReadTool(sourceDir),
        NewGrepTool(sourceDir),
        NewGlobTool(sourceDir),
        // Explicitly NO BashTool, NO WebFetchTool, NO MCPServerTool
    }
    // Three-layer denial:
    // 1. Assembly whitelist (above)
    // 2. Augmentation blacklist filtering
    w.tools = filterBlacklistedTools(w.tools)
    // 3. Input serialization interception
    w.serializer = NewRestrictedSerializer(allowedToolNames)
}

This isn't runtime sandboxing that could be bypassed—dangerous capabilities simply don't exist in the agent's context. The LLM can't execute rm -rf / because there's no Bash tool to invoke, regardless of what prompt injection it receives. It can't exfiltrate data to an external API because WebFetch was never instantiated. The platform constrains what's possible by controlling what exists.

Dependency analysis demonstrates another architectural choice: on-demand decompilation with embedded tooling. The CFR decompiler (a 2.8MB JAR) is compiled directly into the Go binary via go:embed. When an audit task needs to analyze third-party dependencies, the system extracts CFR to a cache directory and builds a class-name index by grepping through JARs. Decompilation only triggers when the index confirms a specific JAR contains classes relevant to the current investigation:

// On-demand decompilation triggered by class lookup
func (d *DependencyManager) decompileIfNeeded(className string) (string, error) {
    // Check index first - avoid blind decompilation
    jar := d.index.FindJarContaining(className)
    if jar == "" {
        return "", ErrClassNotFound
    }
    
    // Decompile single JAR to isolated directory
    outputDir := filepath.Join(d.cacheDir, jar)
    if !d.alreadyDecompiled(outputDir) {
        // CFR embedded in binary, extracted on first use
        cfrPath := d.extractCFR()
        cmd := exec.Command("java", "-jar", cfrPath, jar, 
            "--outputdir", outputDir)
        cmd.Run()
    }
    
    return filepath.Join(outputDir, classToPath(className)), nil
}

This avoids the 40-60 second "decompile everything" approach that would pollute agent context with thousands of irrelevant source files. The index lookup takes milliseconds; decompilation only runs when necessary and caches results for future tasks.

The planner implements stateful multi-round orchestration through a persistent todo queue. Each graph mutation (new fact created, asset registered) triggers a debounced planner wake. The planner maintains a per-task todo list that survives across invocations, only spawning new intents when prerequisite facts exist. This achieves stable audit sequencing—entry point discovery → parameter controllability analysis → sink reachability → vulnerability confirmation—despite using an event-driven architecture where each planner session is a fresh LLM call with no conversation memory.

Workers communicate through activity trace search rather than blocking on fact creation. A worker analyzing authentication bypass can query search_all_worker_traces("unauthenticated endpoints") to find observations from other workers' execution logs, even if those observations weren't formalized as fact nodes yet. This enables cross-worker information reuse without introducing coordination locks.

Endpoint permission classification runs a prioritized decision tree that favors actual runtime behavior over declared annotations. The system checks gateway whitelists first (Zuul/Spring Cloud Gateway route config), then method-level annotations (@PreAuthorize, @Secured), then middleware registration scope. Critically, it flags mismatches where gateway-only token validation results in "authenticated user" access despite lack of role checks—catching cases where developers assume gateway auth is sufficient when application-level authorization is missing.

Gotcha

The platform is 100% static analysis, by design. It cannot confirm actual exploitability because agents cannot execute code or make network requests—the same architectural decision that provides security guarantees also prevents runtime validation. A finding that says "SQL injection possible in UserController.search() because user input flows to JDBC executeQuery" is based purely on code structure. Maybe there's a servlet filter doing input validation that the static analysis missed. Maybe the endpoint is only reachable from internal networks. You get high-confidence code evidence but zero runtime confirmation.

Dependency analysis is JVM-only. The embedded CFR decompiler handles Java/Kotlin/Scala bytecode beautifully, but there's no equivalent for npm packages, Python wheels, Go modules, or native libraries. If you're auditing a polyglot microservices architecture—Spring Boot backend, React frontend, Python ML service, Rust crypto module—you only get dependency decompilation for the JVM components. The rest requires manual source upload or falls back to import-level detection without call-site analysis.

The multi-agent coordination model scales poorly with worker count. Every graph mutation triggers a debounced planner wake, and every worker writes facts/assets/findings that cause mutations. With 20 workers running parallel intents, you get hundreds of planner wake cycles per task, each involving an LLM call to reassess the todo queue and spawn new intents. There's no backpressure mechanism to prevent planner thrashing when the frontier queue already has sufficient work. The per-task todo list is described as "cross-invocation shared" but persistence strategy for planner restarts isn't documented—if the planner crashes mid-task, does todo state rebuild from graph inspection or is progress lost?

Verdict

Use if you're a security team auditing multiple JVM-based repositories at scale and need endpoint inventories with permission mappings, lineage-tracked findings with file:line evidence, and SCA analysis that proves reachability beyond version matching—especially if you're drowning in Semgrep/Snyk false positives and need an "analyst assistant" that can reason about actual data flows. The dual-graph architecture pays off when you need cross-task asset correlation and defensible evidence chains for compliance reporting. Skip if your codebase includes significant non-JVM components (no decompilation for native/npm/Python dependencies), you require runtime validation to confirm exploitability (platform is deliberately static-only), you're auditing closed-source systems where you can't provide full source, or you're evaluating single small projects where traditional SAST determinism and speed would suffice. The architectural security model is elegant but overstated—tool whitelisting prevents capability exposure, but there's no OS-level sandboxing to prevent a compromised LLM from writing malicious data to PostgreSQL.