Documentation

Everything Stateward does, and how to use it

Connect a repository and Stateward reviews every pull request for security, with no pipeline rebuild, read-only, EU-hosted. This page is the full reference: start at the top for the essentials, read to the bottom for the deep technical detail.

Overview

Stateward is autonomous security for your whole codebase. It reviews every change for vulnerabilities, risky dependencies, leaked secrets, infrastructure and container misconfiguration, license and end-of-life risk, and the failure patterns specific to AI-written code. It is built for the way code is written now: fast, AI-assisted, and full of cross-file interactions a single-diff scanner cannot see.

Quickstart

  1. 01

    Connect a repository

    Install Stateward as an app on GitHub or GitLab and grant read-only access to the repositories you choose. There is no pipeline to rebuild and nothing to run in CI.

  2. 02

    Open a pull request

    Stateward reviews the next pull request automatically and posts findings inline, each with a severity, an explanation and, where possible, a one-click fix.

  3. 03

    Or scan from the terminal or your IDE

    Mint an API key in the console, then run the command-line scanner in CI or call Stateward from an agentic IDE through the editor integration. Same engine, before a PR exists.

  4. 04

    Act and gate

    Apply suggested fixes, triage what you accept, export evidence, and gate CI on a severity threshold you control.

Where Stateward runs

  • Code-host app (GitHub, GitLab)

    The default surface. Stateward installs read-only, reviews each pull or merge request inline, and posts a pass or fail check status. No pipeline changes, no agent in CI.

  • Web console

    Run on-demand audits of a branch, browse findings by severity and source, manage repositories and policy, see cost and usage, and administer your organization.

  • Command-line scanner

    Scan any path from a terminal or CI job, write SARIF, and exit non-zero above a severity threshold so a build fails on real risk. Works as a pre-commit hook too.

  • Editor & agent integration (MCP)

    Agentic IDEs such as Cursor and Claude Code can call Stateward on the code they are generating, inline, before a pull request exists. The fast deterministic checks are free; the deep audit draws on your credits.

  • CI gating

    Drop a single scan step into GitHub Actions, GitLab CI, Azure Pipelines or Jenkins. The gate severity can be set per repository in the console so you do not hard-code it in every pipeline.

What we detect

One layer, every surface. Each class below runs in context, mapped to a CWE, with a suggested fix where one applies.

  • Source map exposure

    Stateward’s source-map detector flags it in the pull request, before it ever ships: a committed *.map artifact, a stray //# sourceMappingURL= in a shipped bundle, and build configs that emit production maps across Vite, webpack, Next.js, Create React App, Vue and Rollup. It skips disabled maps and .d.ts.map files, so it doesn’t cry wolf.

  • Logic & correctness bugs real humans write

    This is what Stateward was built for. Its multi-agent adversarial deep audit restates what each function is supposed to guarantee, its invariants, then attacks those assumptions the way a senior auditor does, across the whole codebase. It surfaces the correctness and safety bugs no signature scanner is even looking for: range exhaustion, floating-point money math, ordering and concurrency assumptions, business-logic invariants that silently break.

  • Hardcoded secrets & leaked credentials

    Stateward scans every diff at the commit for known token formats and high-entropy strings, redacts the value (it never echoes or stores a secret), and flags it before it reaches a shared branch. With verification enabled it live-checks GitHub, Stripe and Slack keys against the provider and escalates a confirmed-active key to critical. Findings track state, so a fixed leak stays closed and reopens on regression.

  • Vulnerable & malicious dependencies

    Stateward checks each added or changed dependency against OSV.dev advisories across npm, PyPI, crates.io, Maven, Go, RubyGems, Composer and NuGet, and, with the knowledge base on, tells you whether the vulnerable code is actually reachable, not just present in the lockfile. It also flags end-of-life runtimes (Node, Python, …) that no longer get patches, and exports a CycloneDX SBOM plus a VEX showing which CVEs are genuinely exploitable.

  • Typosquatting & slopsquatted packages

    Stateward’s supply-chain engine flags names within typo-distance of a popular package, packages that don’t exist on the registry (hallucinated/slopsquatted), and non-registry sources (git+, file:, http:), then analyzes each added package’s published behavior: install/postinstall hooks that run network/exec/obfuscated code, or install code with no source repository, the dependency-confusion malware shape that CVE databases miss.

  • Infrastructure-as-code misconfiguration

    Stateward parses added Terraform and Kubernetes lines for open ingress, public resources and ACLs, missing encryption, IAM wildcards, missing logging and privileged/host-network containers, dep-light, diff-scoped, in the pull request.

  • Insecure container images

    Stateward flags :latest/untagged base images, run-as-root, remote ADD, secret-in-layer, pipe-to-shell and insecure fetches over the Dockerfile lines a PR adds, and scans the base image itself for known CVEs so a vulnerable OS package is caught before it ships.

  • CI/CD pipeline attacks

    Stateward’s CI/CD engine inspects GitHub Actions and GitLab CI for script injection, mutable refs, over-broad permissions and secret-in-run, on every change to your pipeline files.

  • Copyleft & source-available license risk

    Stateward flags copyleft and non-OSI source-available licenses in two places: your own code (an SPDX id, a manifest license field, or a LICENSE file, declaration-context gated, word-boundary aware so LGPL ≠ GPL) and, the part teams miss, the licenses of every dependency you add, resolved from the registry and checked against a per-repo license policy you control (deny AGPL/GPL/SSPL/BUSL by default). One place to keep the whole estate legally clean; licenses also flow into the SBOM.

  • Insecure AI-generated code

    Stateward targets the failure patterns of AI-written code specifically, with per-language adversarial review packs and AI-specific checks for hallucinated dependencies, over-permissive defaults and prompt-injection surfaces, the category every incumbent missed.

  • Cross-file vulnerabilities a diff scanner can’t see

    Stateward builds a knowledge base of your codebase, call graph, trust boundaries, dependency reachability, and audits the change’s reachable slice, so it surfaces the cross-file path the diff hides.

Languages, ecosystems & monorepos

Pick a language to see what Stateward checks for it, the package ecosystems it resolves, and its runtime coverage. For the at-a-glance matrix of every language, ecosystem and detector, see the coverage page.

JavaScript / TypeScript

What we check
  • Injection and tainted-input flows (SQL, NoSQL operator, command, code), traced across files
  • Broken access control, IDOR and server-side request forgery (SSRF)
  • DOM and template XSS, prototype pollution
  • Weak or misused cryptography and insecure defaults
  • Hardcoded secrets, with live verification for major providers
  • Vulnerable dependencies (known CVEs), prioritized by whether the vulnerable code is reachable
  • Typosquatted, hallucinated and behaviorally malicious packages (install-hook analysis)
  • Dependency license compliance against your policy
  • AI-generated-code risks: insecure defaults, over-permissive config, prompt-injection surfaces
  • Logic and correctness flaws via the whole-codebase deep audit
Ecosystems
npm, yarn, pnpm
Runtime
Flags end-of-life Node.js runtimes that no longer receive security patches

Application code and committed build artifacts (for example stray source maps) are checked, with framework-aware analysis for Express, NestJS and Next.js.

Monorepos

A repository with several ecosystems is split by folder: each project is detected by its manifest, audited on its own with the analysis suited to its stack, then aggregated into one report.

  • One repository, many ecosystems

    Stateward finds each project inside a repository by its manifest (package.json, Cargo.toml, pyproject.toml, go.mod and more) and classifies each one on its own. A web frontend, a Python service and a Rust engine in the same repository are recognized as three distinct projects.

  • Separated parallel audits

    Each project is audited in parallel with the analysis suited to its stack, then the results are aggregated into one report with a per-project section and a single overall verdict. A single-project repository is audited as one, exactly as before.

  • Pin the layout when you need to

    Auto-detection covers the common cases. Set projects in the per-repo config to pin exactly which folders are treated as separate projects, or to scope an audit to a subset.

How findings work

  • Severity and mapping

    Every finding carries a severity and is mapped to CWE, OWASP and the compliance frameworks you track, so it slots straight into reporting.

  • Provenance

    Each finding shows where it came from: a deterministic analyzer, a deterministic rule, or an adversarial AI agent. You always know whether a result is mechanical or reasoned.

  • Reachability prioritization

    A vulnerable dependency only matters if your code actually uses it. Stateward demotes issues in declared-but-unused packages so the list reflects real exposure, not lockfile presence.

  • Correlation and bundling

    Related results (the same package across files, or one exploit chain) are grouped into a single item so you triage the root issue once instead of clearing a wall of duplicates.

  • Convergence and confidence

    The same issue found by more than one independent analyzer is de-duplicated into one result and gains confidence. Findings are validated before they reach you, not after.

Acting on findings

  • One-click verified fix

    Where a fix is mechanical, Stateward proposes the change and can open a draft pull request on a dedicated branch. Before that PR opens, Stateward re-runs the analysis on the patched file and refuses to open it unless the issue is gone and no new high or critical appears. It never pushes to or merges your branches.

  • Triage and suppression

    Dismiss a finding or accept a pattern, and Stateward respects that on future reviews. Findings track state, so a fixed issue stays closed and reopens only on regression.

Editor & terminal

Agentic IDEs (Cursor, Claude Code)

Add the editor integration and your agent can scan code as it writes it. It exposes:

  • scan_file Scan one file you just wrote, fast and free
  • scan_diff Scan a set of changed files like a pull request
  • audit Run the deep whole-codebase audit (uses credits)
{
  "mcpServers": {
    "stateward": {
      "command": "npx",
      "args": ["-y", "@stateward/mcp"],
      "env": { "STATEWARD_API_KEY": "swu_your_key" }
    }
  }
}

Command line and CI

Scan a path, write SARIF, and fail the build above a severity you choose. The gate severity can also be set per repository so pipelines stay simple.

# scan a path, fail the build above "high", write SARIF
npx @stateward/cli scan . --min high --sarif stateward.sarif

API keys & access

  • Fine-grained, expirable keys

    API keys are scoped to least privilege, can expire, and show their last use. A continuous-integration key limited to scanning cannot touch billing or administration.

  • Personal and service keys

    Personal keys belong to a user; organization service keys are owned by the org and keep working after a member leaves, which is what you want for shared pipelines.

  • Roles

    Members can run audits and see findings. Admins additionally see organization analytics and manage members, projects and policy. Owners control billing and the organization. A billing capability can be granted to a specific admin.

  • Single sign-on by domain

    Set an email domain for your organization and matching sign-ups join it automatically as members. SAML and SCIM are available on request.

ScopeGrants
scanRun scans from the CLI, CI or the editor integration, and read your own results
readRead findings, runs and usage
manageManage members, projects and configuration
billingBilling administration

Per-repo configuration

Tune Stateward per repository, from the console or a checked-in policy file.

SettingWhat it does
minSeverityLowest severity reported
ignorePathsGlobs to skip (generated code, vendored files, binaries). Falls back to your .gitignore when unset
projectsMonorepo project roots to audit separately; auto-detected by manifest when unset
projectMemoryDurable codebase memory and knowledge graph; on by default, set false to opt this project out
enginesTurn individual analysis layers on or off
integrationBranchesBranches whose merges trigger the cross-branch gate
maxCommentsPer-PR comment budget; the rest roll into the summary
contextAuditOn each PR, also audit the codebase slice the change reaches
severityTriageRe-rate each finding by contextual exploitability
verifySecretsLive-verify detected provider secrets; an active key becomes critical
licensePolicyDeny or allow specific dependency licenses
gate.minSeverity at which the CLI fails a build

Exports & interop

  • SARIF

    Export findings as SARIF to load into your code host security tab or any SARIF-aware tool.

  • Software bill of materials (SBOM)

    Download a CycloneDX SBOM of a repository dependencies, including the license of each component.

  • Exploitability exchange (VEX)

    A VEX document states which known vulnerabilities are actually exploitable in your code, using the reachability verdict, so downstream consumers know which CVEs truly matter.

  • Compliance report

    Export an audit-ready report of findings mapped to controls, ready to print to PDF.

  • Shareable posture link

    Mint a public, read-only posture page a buyer can hand their auditor. It shows posture, mean time to remediate and framework coverage, and exposes no source code or credentials. Revoke it any time.

Integrations & alerts

Send a new critical finding to Slack, or open a ticket in Jira or Linear, from the org settings. Secrets stay server-side and are never shown back to the browser.

Compliance & data

  • Read-only and ephemeral. Stateward reads code to analyze it and comments back. It never pushes, never merges, and stores metadata, not your source.
  • Sovereign EU hosting. Code and security data are EU-hosted with EU data residency on Citadea infrastructure.
  • Audit-ready and accountable. Findings map to OWASP, CWE, SOC 2, ISO 27001, NIS2, DORA and the EU Cyber Resilience Act. An access log records who viewed analytics, and you can erase all org data on request.

More on frameworks and evidence on the compliance page.

How Stateward reasons

This is the deepest section. It describes how Stateward reasons, by capability and outcome. We keep the exact mechanics private, the way an engine maker does not ship its blueprints.

  • Classify, then bring the right analysis

    Stateward detects the languages and domains in a change (for example web backend, web frontend, cloud infrastructure, smart contract, AI integration, dependency supply chain, and memory-safety-critical systems code) and brings the analysis suited to each, layered with framework-aware and per-language checks. In a monorepo it detects each project by its manifest and audits each on its own. You do not configure analyzers per language; the right checks run because the code was understood first.

  • Deterministic layer plus adversarial agents

    A layer of fast deterministic analyzers runs on every change and every plan, and adversarial AI agents reason about the novel, cross-cutting risks the deterministic layer cannot. Both flow through one validation pipeline, so a result is confirmed before you see it.

  • A living knowledge base

    Stateward maintains its own knowledge: a history of vulnerabilities, curated real-world cases, and continuously updated package, version and license knowledge. We use it both to find issues faster and to suppress the false positives that make teams mute a tool.

  • Whole-codebase context

    Stateward builds a model of your repository: how modules connect, which inputs are attacker-controlled, and whether a risky function is actually reachable. This is what lets it see flaws that live across files, not on a single line.

  • Merge-induced and cross-branch reasoning

    The hardest flaws appear only when two changes meet. Branch A and branch B can each be safe, yet merging both into a shared branch creates a new vulnerability. Stateward reasons over that combined picture. This cross-context, branch-aware analysis is the part nobody else does well.

  • Durable, evolving project memory

    That model is remembered between runs and kept current as the code changes, per project, per folder in a monorepo, and per branch. Stateward records what it learns: the project’s shape, its data flows, its dependencies and the intent behind them. So a new pull request is reviewed against what we already know, without re-reading the whole repository, and when a branch is merged its knowledge is folded into the target. Memory holds structure and observations only, never your source, and any project can opt out.

  • Dependencies tracked over time

    Because the model knows which package each part of your code uses and what those pull in transitively, a dependency that becomes vulnerable after it shipped is traced back to the exact component and the files that use it, and flagged in time, through the channels you choose. A vulnerability deep in the dependency tree is named together with the direct dependency that brought it in.

FAQ

What is a merge-induced vulnerability, and how does Stateward catch it?+

It is a flaw that exists in neither branch on its own but appears when two branches merge, for example one branch adds a handler that forwards a user-controlled URL while another quietly drops an allowlist, and together they create an SSRF. Per-PR scanners miss it because each diff looks safe. Stateward reasons over the prospective merged state of the codebase, so it flags the interaction before it reaches your default branch.

Why review the whole codebase instead of just the diff?+

The worst vulnerabilities rarely live in a single diff. A change that looks harmless can pipe user input into an unsafe function defined in another file, or reach a sink through a chain of calls a line-by-line scanner never sees. Stateward builds a knowledge base of the whole project, call graph, trust boundaries and dependency reachability, so it analyses the change in the context that actually determines whether it is exploitable.

How does Stateward avoid drowning me in false positives?+

Every candidate finding is validated before you see it: results are deduplicated across engines, strengthened when independent agents converge on the same issue, then attacked adversarially, can it actually be reached and triggered, what is the real impact. Weak claims are dropped and only severity-rated findings with a reproduction are posted, scoped to your diff, not a 4,000-item backlog.

How is Stateward different from Snyk or Aikido?+

Stateward unifies SAST, dependency auditing, secret detection, AI-generated-code review and compliance mapping into one autonomous layer, then triages and deduplicates across all of them so you get fixes, not a wall of red. It is built from day one for AI-written code and hosted on EU infrastructure with EU data residency.

Does it actually understand AI-generated code?+

Yes, that is the category it was built for. Stateward targets the failure patterns specific to Copilot-, Cursor- and Claude-written code: insecure defaults, over-permissive configs, hallucinated or typosquatted dependencies, and prompt-injection surfaces no legacy scanner was trained to catch.

Will it spam my pull requests with noise?+

No. Findings are scoped to the lines you changed, deduplicated across every engine, ranked by real exploitability, and re-pushes update the existing review instead of posting duplicates. You set the minimum severity and ignore paths per repo.

Can Stateward see or change my code?+

It has read-only access, granted through your provider’s OAuth, it can comment but never push, merge or alter code. Stateward never stores your credentials, and code is analysed in an isolated, short-lived environment that is discarded once the review is posted.

Where is my code hosted and processed?+

Today your code is processed on sovereign EU infrastructure with EU data residency, so your code, findings and security data stay inside EU jurisdiction.

What if Stateward goes away?+

Nothing breaks. Stateward is read-only and adds nothing to your pipeline, removing it is one click and you’re exactly where you started. Analysis runs on open engines, not a proprietary black box, and we offer source & continuity escrow so the engine is always maintainable.

What does it cost?+

Deterministic scanning is free on every tier. The AI analysis is metered in credits, where one credit is one dollar. Open source and solo devs are free: every public repo gets free deterministic scanning, open-source projects can request a sponsored AI-analysis grant by emailing hello@stateward.com, and private repos get a monthly credit grant. Teams are $40/month for a credit allowance plus the platform; enterprise is custom. No seats, no per-repo counting, no credit card to start.

Do you charge per developer or per repo?+

Neither. Your bill never grows because you hired, because a bot pushed code, or because you split a service into more repositories. You pay a small subscription plus credits for the AI analysis you actually use, and the deterministic scanners are always free.

What does it take to get started?+

Install the app on GitHub or GitLab and grant read-only access to the repos you choose. There is no pipeline to rebuild, Stateward reviews your next pull request automatically.

Does it replace my security team?+

It gives teams that could never staff an AppSec function the coverage of one, and it makes existing security teams faster by handling the repetitive review, triage and evidence work. It supports human judgement, it does not replace it.

Does Stateward handle monorepos?+

Yes. Stateward detects each project inside a repository by its manifest (for example package.json, Cargo.toml, pyproject.toml, go.mod), classifies each on its own, and runs a separated audit per project in parallel. The results are aggregated into one report with a per-project section and a single overall verdict. You can pin the exact project folders with the projects setting in the per-repo config.

How do I exclude files or folders, like binaries or vendored code, from a scan?+

Set ignorePaths in the per-repo config to a list of globs to skip. When you do not set it, Stateward falls back to your repository .gitignore, so the files you already keep out of version control stay out of the scan too. Build artifacts, lockfiles and common binary types are always skipped.

Can I restrict what an API key can do?+

Yes. Keys carry least-privilege scopes (scan, read, manage, billing), can expire, and can be personal or org-owned service keys. A scan-only key used in CI cannot reach billing or administration.

Do you check dependency licenses?+

Yes. Stateward resolves the license of each added dependency and checks it against a per-repository policy you control, so copyleft or source-available licenses do not slip into a proprietary product. Licenses also flow into the SBOM.

Do you flag end-of-life runtimes?+

Yes. A runtime past end-of-life no longer gets security patches, so Stateward flags declared runtimes (for example Node, Python, PHP) that have reached end-of-life. It is a high-signal, low-noise finding.

Can I run Stateward in CI?+

Yes. The command-line scanner runs in any pipeline, writes SARIF and fails the build above a severity threshold. The threshold can be set per repository in the console. Recipes exist for the common CI systems.

Where is my code processed?+

Code and security data are EU-hosted with EU data residency. Stateward stores metadata, not your source.

Still evaluating?

Read-only & ephemeral

Stateward can comment, but never pushes, merges or stores your keys.

EU hosting & data residency

Code and security data stay EU-hosted with EU data residency, built for NIS2, DORA and the CRA.

Whole-codebase aware

Reasons over your call graph and trust boundaries, not just the diff.

Stateward is live and ready to guard your code. Built by Yggdrasil Digital.