Inputs and trust boundaries
Map browser input, API payloads, webhook events, file uploads, model output, and internal tool calls before judging individual functions.

AI code security
Reviewed by Sentrail · Updated August 17, 2026
Threat model
Generated and hand-written code can expose the same classes of risk. The review should follow data, identity, privilege, and deployment paths.
Map browser input, API payloads, webhook events, file uploads, model output, and internal tool calls before judging individual functions.
Trace how a request becomes a user, tenant, role, or privileged service action. Review authorization at each data-changing boundary.
Identify sensitive records, credentials, tokens, logs, and generated output. Verify where they can flow at runtime and in the build pipeline.
Include package advisories, CI permissions, environment-variable exposure, preview environments, and hosting protection in the model.
Analysis layers
Semgrep
Find code patterns that match known unsafe constructs. Treat results as findings to triage, not automatic proof of exploitability.
Gitleaks
Search the commit contents for credential patterns, then fingerprint and redact matches before contextual triage.
OSV-Scanner
Resolve package manifests against the OSV vulnerability database and review whether affected versions are actually present.
Contextual
Read auth, middleware, webhooks, environment plumbing, and migration files because important authorization mistakes are rarely one-line patterns.
Runtime controls
Verify ownership and tenant checks on reads and writes. A route protected by login still needs object-level authorization.
Inspect RLS status, policy counts, policy expressions, grants, security-definer functions, and exposed schemas using the live database configuration.
Classify environment variables by exposure risk and inspect hosting protection. Local configuration does not establish production posture.
Bind findings to a commit and timestamp. When required evidence fails, has never run, or is stale, return insufficient evidence instead of a score.
Repeatable workflow
Run secret, dependency, and static-analysis scanners against an isolated copy of the commit.
Redact secret values, inspect nearby code, and distinguish a likely true positive from noise or an uncertain result.
Post findings to the pull request and check run, with merge blocking on critical results only when the repository opts in.
A push or pull request on a monitored repository queues a scan run.
An isolated scanner service runs Gitleaks, OSV-Scanner and Semgrep against the commit tarball.
Matched secrets are fingerprinted and redacted before any finding reaches a language model.
Findings are ranked and labelled — true positive, likely false positive, needs review — with reasoning attached.
Results post back as a pull request comment and a check run. Blocking merges on criticals is opt-in per repository.
LLM review limitations
A language model can explain code and connect context across files, but it can miss paths, hallucinate configuration, misunderstand runtime state, and produce different answers for the same input. It also cannot infer the current database or deployment configuration from repository text alone.
The stronger pattern combines deterministic rules, direct system evidence, and contextual analysis. Each compensates for a different blind spot, while a human retains the final remediation decision.
Human approval
The agent writes a fix proposal — SQL, or exact file contents — against the finding. Nothing is written to your database or repository at this stage.
The proposal parks in an approval queue with its diff, its blast radius, and the finding it closes. Sensitive actions cannot skip this queue.
A reviewer on your side approves or rejects. Approval is recorded with who approved it and when.
On approval Sentrail opens a draft pull request on its own branch. It re-checks the base commit first and aborts if the branch moved underneath it.
Sentrail never merges. Every change lands through your normal review and CI, and the re-verification scan runs after the merge you performed.
Engineering checklist
Run current checks across your repository, database, dependencies, and deployment, then keep every proposed change behind human approval.