Using CodeNavi for cybersecurity¶
CodeNavi gives a security reviewer, or the AI agent working for one, a fast way to find the right code in a large codebase and to prove where each finding came from. This page lists the security jobs it helps with, and links to the steps for each one.
This page is about your code. To learn how CodeNavi itself is secured, read the security model.
What you can do¶
| Your question | What to use | Steps |
|---|---|---|
| Where are the security checks in this unfamiliar code? | semantic_search, find_callers, impact_analysis |
Secure code review walkthrough |
| Where do we stand against OWASP ASVS, the OWASP Top 10 or EU CRA Annex I? | /codenavi:compliance (or your agent's equivalent) |
Compliance gap analysis |
| Are we exposed to this CVE in a dependency? | Ask your agent. The compliance-check skill runs the procedure. |
Dependency reachability |
| What does this pull request touch? | diff_impact |
CI review bots |
| Which files does nothing use? | find_orphans |
API reference |
| Are there secrets or hidden instructions in our repositories? | The scanner and the Security screen | Find secrets and hidden instructions |
| How do we send security events to our SIEM? | Event hooks, scanner files, metrics | Send events to your monitoring |
| What can we give an auditor? | Reports with file:line citations and a self-hash |
Evidence integrity & auditability |
Review code you do not know¶
A reviewer who knows the code searches for check_permission. A reviewer who does not know the code does not know that name exists. Semantic search accepts the question in plain words and returns the code with file:line citations. Then find_callers and impact_analysis show who calls that code.
The walkthrough shows two real review sessions, with the actual queries and one query that missed. The sample reports show the output of a full OWASP Top 10 run on public source.
Check whether a CVE reaches your code¶
A dependency scanner tells you that a package has a CVE. It does not tell you whether your code calls the vulnerable function. Ask your agent, for example "are we exposed to CVE-2026-1234 in the requests package?". The procedure finds the pinned version, the imports and the call sites, then reads each site to see if untrusted input reaches it.
Reduce the attack surface¶
A forgotten endpoint is code that nobody patches but an attacker can still reach. find_orphans lists the files that nothing in the repository refers to. Read each file before you delete it: a file reached only by an outside URL, or loaded by a framework convention, also looks unused. find_orphans is not in the default tool list: call it with reveal_tools(call="find_orphans", args=...). See the API reference.
For a pull request, diff_impact lists every caller of every symbol that the diff changes. A CI review bot can run it on each pull request.
Find secrets and hidden instructions¶
The scanner reads every file when CodeNavi indexes it. It looks for credentials, payment card numbers and IBANs, and for prompt-injection text in code and documents. To see the results, open the Security screen in the web UI.
- Dry-run is the default. In dry-run, the scanner tags what it finds and blocks nothing. Read the flagged chunks first. Then turn dry-run off, so that files with blocking findings go to quarantine.
- The index is clean, but your file is not. Redaction changes only the index. The secret stays in your source file and in your git history until you remove it. Rotate a real credential.
- Redaction covers CodeNavi's search results,
read_file,grep_searchandrule_evidence. Your agent's own grep and file reads show the file as it is. See Tool surface. - The scanner sees only what is indexed.
vendor/,node_modules/and similar folders are excluded by default.
Send events to your monitoring¶
- Event hooks. A hook sends
scanner.blockedwith the file path and the rule IDs, and never the secret value. This event fires only when a file goes to quarantine, so it does not fire in dry-run. If your SIEM gets no events during dry-run, that does not mean your code is clean. - Files. The scan ledger, threat reports and retrieval-flag log are plain files that your SIEM can collect. See what each file records.
- Metrics. Prometheus metrics and a Grafana dashboard are in Observability.
What stays on your machine¶
The index, the embedder, the call graph and the scanner run on your hardware. Your AI agent is a separate product: if the agent uses a cloud model, that model receives the code the agent reads. For security reviews of sensitive code, use a local model or an agent your organization has approved. See air-gapped code RAG.
What this does not do¶
- CodeNavi is not a vulnerability scanner, a penetration test or a certification. It finds code. Your agent reasons about the code, and a person must confirm every finding.
- Everything is static. No request touches a running application.
- Call edges are name-based. Two functions with the same name can be mixed up, so read the sites that the tool returns.
- "Not found" does not mean "not there". A "not reachable" answer means that these searches found no path. It does not mean "not exploitable".
- Scanner rules match known patterns. A secret in an unusual format can pass. Keep your other security tools.