References & Sources

Lagune vs. Deepsec: Two AI-Driven Security Approaches, Side by Side

A reference comparing Lagune and Vercel's Deepsec across how they work, lifecycle, detection, cost, findings, and closure.

Lagune and Deepsec (v2.2.1) are two defensive answers to the same problem: security in the age of AI-assisted development. Their premise, their beginning, middle, and end, and how each presents itself to a user diverge by design, even where their mechanics overlap.

tip

Is Lagune inspired by Deepsec? No, Lagune is written from scratch and is inspired by Spec-Driven Development and Security Hardening. The two projects were developed independently, and the comparison here is to help users understand their differences.

At a glance

AspectLaguneDeepsec
KindA methodology (SDH) with a reference implementationA product: an agent-powered vulnerability scanner
Center of gravityA charter and on-demand knowledge drive the agent, grounded in deterministic hooksA wide regex net feeds a mandatory AI investigation
What it producesHardened code, proofs, and a tracked chain of findingsA severity-ranked, triaged findings report
Touches your codeYes: harden edits your codeNo: static analysis only, emits findings and recommendation text
RuntimeRuns on the agent and model you already run, any tierRuns its own model pipeline, a frontier tier by default
Getting startedOne init, then drive it in plain language, no new tool to stand upStand up a .deepsec/ workspace, install deps, and add a model key

How it works

Lagune is agent-first: the agent drives, pulls in knowledge on demand for what the code is, and delegates a decidable slice to the deterministic hooks.

Deepsec is deterministic-first: a wide scan flags candidates that point a mandatory model at what to investigate and judge.

AspectLaguneDeepsec
OrderCharter and matched knowledge steer the agent, which delegates to hooks and judges the restMatchers flag candidates, the model investigates and judges each
Deterministic roleMulti-language hooks that return a verdict or aim the agent, combined with category knowledgeMatchers that flag candidates for the mandatory model to judge
Development flow/lagune builds securely inline as you codeIt reviews code, it does not write it
Audit flowcharterdetectplanhardenverifyscanprocesstriagerevalidatereport
The AI's jobReason from the knowledge, apply the fix, and prove it holdsInvestigate every candidate and report the findings

Lifecycle

Lagune works before, during, and after the code is written. Deepsec reviews a repository once the code exists.

MomentLaguneDeepsec
Before code existscharter mints a security policy from stated intentStarts from existing code: init needs a directory
While building/lagune builds safe-by-default inline, no artifact left behindReviews after building, not during it
On existing codedetectplanhardenverifyscanprocess, the core flow
Continuous reviewRe-run phases per scope, no packaged CI gateIncremental re-scan, process --diff as a CI exit gate

Detection layer

The two deterministic layers are opposite in kind: one decides, the other flags.

AspectLaguneDeepsec
GroupingSecurity groups and hooks per specialization or sub-skillMatchers per pattern or framework
OutputLiteral verdict (finding / review / advisory) plus a classify labelVerdict-less candidate (slug, lines, snippet, matched pattern)
TuningPrecision: comment-aware, placeholder and window guardsRecall: wide nets, the AI prunes false positives after
DepthDeeper on shared classesBroader, less deep on shared classes
False positivesKept low at the source, then judged in contextOver-generated on purpose, cut back by a revalidate pass

Knowledge and judgment

Both carry security knowledge the regex cannot. They differ in where it lives and who can shape it.

AspectLaguneDeepsec
FormEditable markdown modules, several backed by a deterministic hookA short prompt and per-tech highlights, drawing on the model's own knowledge
SelectionMatched to the code, loaded only when its context is presentInjected into every AI batch, plus highlights for the detected tech
Who authors itThe user edits modules and adds new ones with specializeThe maintainer owns the prompt, the user fills an INFO.md
Where judgment sitsThe hooks decide their floor, the agent judges the rest from the knowledgeCentralized: one AI processor judges every candidate
ReuseOne module guides both detect and verifyOne prompt drives the single process stage

Findings and closure

They diverge most on what a finding becomes once it is resolved.

AspectLaguneDeepsec
SeverityA CVSS v4.0 score, adjusted for exposure and stakesAn AI severity, plus a P0 / P1 / P2 triage of exploitability and impact
VerdictsRisk closed, not closed, or cannot tell from the codetrue-positive, false-positive, fixed, uncertain, accepted-risk, duplicate
PersistenceWorking chain reconciles, closed findings distilled to a historyAppend-only per-file records, nothing removed
End stateClosable: a proven finding stands down, the chain can restEvery finding is kept for good, hidden from views once resolved
History detailA compact summary of what the risk wasThe full verdict trail, including how it was fixed

Cost

AspectLaguneDeepsec
Deterministic floorFree: hooks run with no AI, no key, no network, already emitting verdictsFree: scan runs with no AI, but emits no verdicts on its own
Typical billFolded into an agent you already run, down to $0 on a local model, the plan price you already use, or per iteration for API-based usageRoughly $25 to $1,200 per run for 100 to 2,000 files, more at scale
Cheapest pathAny model, including a free local one, closes the cycleCheaper paid tiers exist, but findings need the paid AI stage

Extensibility and governance

Each opens the layer the other keeps closed.

AspectLaguneDeepsec
What you extendEdit modules, or add new via specializeAdd matchers, agents, notifiers, and ownership
Policy layerThe charter governs every phase and is versionedConfig is operational (matchers, models, paths)
Override by nameA refined module shadows the built-inA matcher slug collision, your matcher wins

Interfaces

Deepsec emits deliverables for a security organization. Lagune renders a live view for whoever runs it.

AspectLaguneDeepsec
Human surfaceA live local dashboard of the whole chain, in plain languageReport, export, metrics, and PR-comment files, plus a docs site
AccountabilitySurfaces files and the sub-skills that appliedRoutes a suggested assignee: on-call, manager, or committer
Reproducible proofprove writes runnable tests and a disclosure advisoryStays static by design, it never executes the target
Tool self-defenseHardens a local write API on the dashboardHardens its own AI execution against untrusted target code

Scale and deployment

AspectLaguneDeepsec
InstallScaffolds files into the repo, no separate runtimeA .deepsec/ workspace with its own package and dependencies
Scale directionScopes to any slice, a context, one file to the whole projectSweeps whole repositories, up to large monorepos
DistributionLocal only, the one server binds to loopbackOptional fan-out across Vercel Sandbox worker VMs
PortabilityRenders commands to dozens of agent formats, adapters as dataDrives a small set of agent SDKs, plugin-extensible

User experience

How each meets the person running it: what the first run takes, and how the operator aims it.

Onboarding

Lagune runs through the agent already open. Deepsec provisions its own workspace and model access first.

AspectLaguneDeepsec
First commandnpx -y lagune@latest init, then /lagune.* in the agentnpx deepsec init, then cd .deepsec, pnpm install, scan, process
Credentials to runNo separate key, it uses your current agentA model key (e.g., AI Gateway, a 12-hour Vercel OIDC token, or an Anthropic token)

Driving it

Both take direction. Lagune reads the shape of the input per phase. Deepsec narrows the file set the same investigation runs over.

AspectLaguneDeepsec
Whole projectA phase with no input scans the whole scopescan and process sweep the repository
A sliceAny phase scopes to given files or directories--files, --files-from, or --diff narrow the run
A concernA phase scopes to a described worryThe investigation prompt is fixed
A priority bandharden and verify scope to Critical, High, Medium, or LowFindings are labeled after the run
A single valueA hook scores one snippet, pattern, or URL directly (-p, -u)The unit of work is a file

Frequently Asked Questions

Lagune is agent-first and works before, during, and after the code is written: it sets policy before code, hardens inline while building, and audits, hardens, and verifies code already written. Deepsec is deterministic-first: a wide regex scan feeds a mandatory frontier-model investigation that reviews existing code and reports findings, without changing it.

Lagune's whole flow can run at $0 on a free local model, and its deterministic hooks emit verdicts with no AI at all. Deepsec's scan is free but emits no verdicts, so any finding requires its paid AI stage.

Lagune does: harden applies fixes to your code. Deepsec does not: it is static analysis only, emitting findings and recommendation text that a person or agent applies separately.

Last updated on July 24, 2026.

Copyright © 2026-present Weslley Araújo and contributors. Lagune is under the MIT License. Please check the Security Policy.

All product names, trademarks, and registered trademarks mentioned are the property of their respective owners and are used for identification purposes only.