All posts

Agent security

What Makes an AI Code Security Finding Actionable? From Alert to Verified Fix

Turn a security alert into a reproducible finding, scoped fix and verified result. Inspect identity, object access and legitimate behavior after remediation.

Harden cover: Actionable Findings. A right-column alert to test to fix diagram illustrates the workflow. Conceptual editorial artwork; no measured result is depicted.

Executive summary

An actionable AI code security finding identifies a consequential behavior, the conditions that expose it, a reproducible check, an accountable owner, and evidence that verifies the fix. A warning without that chain is a lead for investigation. Our worked example follows a synthetic cross-tenant invoice defect from alert to retest. It is an illustrative review packet, not a claim about a customer's application or a scanner's measured accuracy.

Turn the alert into a testable statement

Suppose a review flags an invoice handler because it loads an object using a client-supplied identifier without an evident tenant check. The alert may be correct, incomplete, or wrong because another layer enforces authorization. The next step is to establish the actual behavior.

Write a narrow finding statement: under the specified identity and route, can a user retrieve an invoice owned by a different synthetic tenant? Identify the affected revision, endpoint, object, operation, and expected boundary.

Avoid starting with a severity label detached from prerequisites. A reviewer needs to know whether the endpoint is reachable, what authentication is required, which identities are affected, and what information or effect the operation exposes.

Our generated-code review checklist covers the broader merge decision. The finding packet is the smaller artifact that lets an engineer reproduce one defect and verify its remediation.

Preserve evidence without creating another exposure

Use two synthetic tenants with clearly distinguishable invoices. Record the allowed same-tenant request and the prohibited cross-tenant variation. Keep the relevant request shape and response evidence, with sensitive values replaced by controlled fixtures.

Record the environment and revision. A finding reproduced against an old local branch may not describe the current deployed service. If a gateway, database policy, or background worker affects the result, include that configuration in the evidence boundary.

Identify who can reproduce the issue through an authorized route. Evidence should remain useful without granting every recipient access to the affected system or sensitive records.

Separate observation from interpretation. “The response contained South's synthetic invoice while authenticated as North” is an observation in a completed test. “This could expose customer invoices” is an impact interpretation whose prerequisites should be stated. Do not write either as an observed result until the exercise actually runs.

For a real report, store restricted evidence through the team's established process. Avoid pasting live credentials, customer records, or full production responses into broadly accessible issue trackers simply to make a finding look convincing.

Check whether another layer supplies the control

The absence of an authorization check in one handler does not alone prove exploitability. Trace the identity and object through the relevant middleware, service, and data-access layers. Inspect the actual route rather than assuming a convention is enforced everywhere.

Likewise, the presence of a tenant helper does not prove correct behavior. The helper may use client input, receive the wrong identity, or be bypassed by another operation. Behavioral tests should exercise the boundary with distinct identities and objects.

If the finding is a false positive, record the evidence that resolves it. A maintainer's explanation can direct the investigation, but the closure should identify the enforcing layer and applicable configuration. That record helps prevent the same ambiguous warning from consuming review time later.

If the evidence remains incomplete, keep the finding open with a specific next check and owner. “Needs investigation of the export worker's tenant context” is more actionable than a permanent unqualified high-severity label.

Propose a fix at the right boundary

The remediation should correct the authority source and enforcement path. For the invoice example, deriving tenant scope from the trusted identity and applying the required object authorization may be appropriate. The exact implementation depends on the application's architecture.

Do not accept a patch that merely rejects the test's particular invoice identifier. The defect concerns the relationship between identity, object, and operation. The fix should address that relationship across the affected paths.

Review adjacent operations such as update, export, attachment download, and queued work when they share the vulnerable logic. Keep the scope tied to the defect rather than turning every finding into an uncontrolled rewrite.

Ask the coding agent to provide the proposed diff, reasoning, tests, and known assumptions. A second model's agreement can help organize review, but it does not independently establish correctness. The accountable engineer should inspect the behavior and artifacts.

Verify both the rejection and useful behavior

Retest the original prohibited variation against the corrected revision. Inspect the actual response and any target-side effect. For writes or background jobs, a denied HTTP response may be insufficient if work was already queued or performed.

Then run the legitimate same-tenant operation. A fix that prevents all invoice access avoids the synthetic cross-tenant response while breaking the product. Include the intended functionality in the acceptance criteria.

Preserve the original reproduction as a meaningful regression check. It should fail when the relevant authorization boundary is removed, rather than asserting that a particular helper name appears in the code. This makes the test useful as the implementation evolves.

Record the closure with the fixed revision, evidence references, reviewer, and remaining limitations. If the patch is merged but not deployed, say so. Implementation, verification, and production rollout are separate states with different practical implications.

Keep runtime findings and code findings distinct

A coding agent may attempt an unauthorized database export while investigating the defect. That is a runtime action question. The generated handler's missing authorization is an application behavior question. Both may deserve attention, but their fixes and evidence differ.

Harden evaluates supported pending agent calls using task context and policy. A relevant runtime decision can be included in the workflow record. It does not prove that the resulting application correctly authorizes requests after deployment.

Use Control to evaluate the supported agent path with synthetic cases. If the team needs to connect action evidence to its existing review process, Book a Call with one redacted finding packet. Keep the acceptance criterion concrete: a reviewer can reproduce the behavior, inspect the fix, and understand what remains unverified.

FAQs

Is every scanner warning a confirmed vulnerability?

No. A warning identifies a condition to investigate within the tool's scope. Confirm the relevant behavior, prerequisites, and enforcing layers. Keep an incomplete lead separate from a reproduced defect, and record evidence when a finding is resolved as a false positive.

What makes a reproduction useful?

It names the revision, environment, identity, input, expected boundary, and observed effect. Use harmless fixtures where possible. Another authorized reviewer should be able to repeat the check without guessing hidden setup or obtaining unnecessary access to production data.

Can the agent that wrote the patch verify it?

It can run checks and organize evidence, but assign the final review according to the team's ownership rules. Inspect consequential results directly. A generated explanation or agreement between agents is not a substitute for meaningful tests and accountable review.

When can we mark a finding closed?

Use explicit status definitions. A verified fix needs evidence that the prohibited behavior is corrected and intended behavior still works. Track deployment separately where relevant. Do not collapse a proposed patch, merged change, and released remediation into one ambiguous resolved state.

Should the finding include a proposed implementation?

A proposed fix can help, but the essential requirement is a clear defect and acceptance criteria. Leave room for the owner to choose the correct architectural boundary. A narrow test-specific workaround should not satisfy a finding about broader authorization behavior.