By NHI Mgmt Group Editorial TeamBased on Checkmarx: “Building an AI Security Agent Is Easy. Operating One Is Harder.” (June 10, 2026)

TL;DR: AI security agents can look convincing in demos, but production accuracy depends on context engineering, harness engineering, and access controls as repositories, languages, and code states change, according to Checkmarx. The real risk is not model capability alone, but whether enterprises can make automated verdicts repeatable, auditable, and safe at scale.


At a glance

What this is: Checkmarx shows that AI security agents fail most often in production because context, harness, access, and evaluation controls are harder to operationalise than the model itself.

Why it matters: IAM, NHI, and AI security teams need this distinction because production trust depends on who can see what, what the agent can act on, and whether every decision is traceable.


Context

AI security agents are software systems that use models to analyse code, triage findings, or generate fixes, but their reliability depends on more than the model call itself. The article’s core governance gap is that prototypes assume clean inputs and stable repository state, while production introduces partial checkouts, changing commits, multi-language codebases, and access boundaries that the agent must respect.

That makes the problem part AI governance, part application security, and part identity governance. The key issue is not whether the agent can produce an answer, but whether it can do so with the right context, under the right permissions, and with a durable audit trail when its outputs influence security decisions.


Key questions

Q: What breaks when AI SOC agents do not have enough context?

A: They become brittle, overconfident, and inconsistent because they can only act on the visible event, not the organisational reasoning behind it. That leads to false negatives, weak attribution, and repeated investigations that humans would resolve faster. Context is not optional metadata in SOC automation. It is the basis for trustworthy machine judgement.

Q: Why do AI agents require more than model access controls?

A: AI agents can choose tools, call APIs, and trigger workflows, so model access alone does not govern what they can do. Teams need separate controls for prompts, tool use, and consequential actions. Without that distinction, an approved AI session can expand into enterprise systems in ways the original approval never intended.

Q: How do security teams know whether an AI triage agent is actually reliable?

A: They know it from labelled evaluation data, regression testing, and production monitoring that measures accuracy over time, not from a single successful demo. Reliability means the same class of finding is handled consistently across languages, vulnerability types, and model or prompt changes. If the evaluation set is stale, trust is fictional.

Q: Should organisations build their own AI security tools or buy external solutions?

A: Most organisations should buy unless they have very specific needs, strong privacy concerns, and enough in-house expertise to build and maintain the system. Custom AI takes substantial time, resources, and specialist capability, which makes it impractical for many teams. External solutions usually offer a faster, more cost-effective, and easier-to-scale path.


Technical breakdown

Why prompt engineering is only the visible layer

Prompt engineering shapes how an AI agent frames a task, formats output, and follows instructions, but it does not solve correctness on its own. In security workflows, the model can only reason over the evidence it receives. If the code state is stale, the finding is incomplete, or the repository context is missing, a well-written prompt still produces a fragile decision. Production failures often look polished because the prompt output is syntactically valid even when the underlying judgement is wrong.

Practical implication: Treat prompt design as one control layer, not the control plane for trust.

Context engineering decides whether the model has enough evidence

Context engineering is the work of finding the exact repository state, relevant files, dependency paths, and data flow needed for a correct verdict. In large monorepos or multi-service systems, the finding is often only a pointer, not the full payload. The agent has to reconstruct the right slice of code from scanners, source control, and dependency metadata before it can decide whether a vulnerability is real or how a fix should behave. Without that evidence, the model is guessing.

Practical implication: Build retrieval and code-state resolution before you rely on any automated triage verdict.

Harness engineering is what makes an AI agent governable

Harness engineering covers the orchestration and control layer around the model: evaluation, guardrails, isolation, observability, retries, fallbacks, and durable state. This is also where identity and access controls become central, because the agent must not expose code a user cannot see or cross tenant boundaries in shared environments. The same layer must preserve auditability, deduplicate repeated findings, and keep decisions explainable long after the original run. In practice, this is the difference between a model demo and a production service.

Practical implication: Design the agent’s harness as a governed production system, not an experimental wrapper.


Threat narrative

Attacker objective: The objective is to influence the agent’s decision-making so that security teams trust a wrong verdict or expose data the user should not see.

  1. Entry occurs when the agent ingests attacker-influenced source code or an incomplete code state and treats it as evidence for triage.
  2. Credential or context abuse follows when the model reasons without the exact commit, file, or dependency state needed for a sound verdict.
  3. Impact appears as a confident but wrong security decision, including missed vulnerabilities, unsafe fixes, or leakage across access boundaries.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Context trust, not model quality, is the decisive control boundary for AI security agents. The article shows that a competent model can still fail when the repository state, file selection, or dependency picture is wrong. That makes accuracy a governance outcome, not just an engineering one. Practitioner conclusion: if the context is incomplete, the verdict is untrusted regardless of how fluent it sounds.

Harness engineering is the named control gap this category keeps exposing. Many teams over-focus on prompt design and under-build the orchestration, isolation, observability, and regression testing needed for production use. That gap is especially visible when automated findings affect code, tickets, or remediation workflows. Practitioner conclusion: the harness is the product boundary that determines whether the agent can be operated responsibly.

Identity and access control become part of AI agent governance once the agent can inspect real code. The article makes clear that per-user and per-repo permissions, tenant isolation, and data leakage prevention are not add-ons. They are the conditions that keep the agent from turning code analysis into unintended disclosure. Practitioner conclusion: treat the agent as a privileged system that must inherit least-privilege discipline.

Evaluation debt is now a standing operational risk for security AI. The article’s point about model swaps, regressions, and changing languages is that quality decays silently unless it is measured continuously. That creates governance debt similar to other long-lived production systems, except the failure mode is confidence without correctness. Practitioner conclusion: no agent should be trusted without a living evaluation programme.

AI security agents need a repeatable assurance model before they need more capability. The category will mature around traceability, isolation, and governance of automated decisions, not around bigger prompts or larger models. Organisations that cannot reconstruct what the agent saw and why it decided will struggle to defend its outputs internally or in audit. Practitioner conclusion: assurance must scale with automation, or automation should stay constrained.

From our research library:

What this signals

Production trust for AI security agents will become a governance discipline, not a feature checklist. The article is right that model capability is the easy part and operational reliability is the hard part. For practitioners, the programme question is whether every automated verdict can be traced back to the exact evidence it used, the permissions it had, and the workflow state it changed.

AI agent harnesses should be measured like other privileged production systems. That means observability, isolation, and auditability are part of the control plane, not optional engineering polish. When an agent can read source code and influence remediation, it sits inside the same trust boundary as other systems that can create security outcomes, so its behaviour has to be governed accordingly.


For practitioners

  • Define the exact code-state retrieval path Ensure the agent can resolve the scanned commit, branch, file, and dependency version for every finding before it attempts triage or fix generation.
  • Separate prompt quality from evidence quality Review the retrieval and context-selection pipeline independently of the model prompt so that missing or stale context is visible as a control failure.
  • Apply per-user and per-repo access controls Enforce least-privilege access so the agent only sees code and metadata the requesting user is authorised to inspect, including in multi-tenant setups.
  • Build regression testing into every model change Maintain labelled evaluation sets for triage accuracy and remediation quality, then rerun them whenever prompts, models, or repository coverage changes.
  • Treat the agent as a governed production service Add audit logging, deduplication, idempotent workflow handling, and human approval gates for high-impact actions before the system is allowed to operate broadly.

Key takeaways

  • AI security agents fail most often when production context is incomplete, stale, or too large for the model to reason over reliably.
  • A plausible automated verdict is more dangerous than an obvious error because it can quietly shape remediation and triage decisions.
  • The practical control point is the harness, where access, observability, evaluation, and auditability determine whether the agent can be trusted.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Agentic AI Top 10 and OWASP API Security Top 10 address the attack and risk surface, while NIST AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Agentic AI Top 10ASI03 — Identity & Privilege AbuseThe article centres on agent permissions, access boundaries, and trusted execution scope.
ASI06 — Memory & Context PoisoningStale or attacker-influenced source context drives wrong verdicts and unsafe decisions.
Recommendation — Constrain agent privileges and review any workflow where the agent can read or act on sensitive code. Harden context retrieval so the agent cannot reason over stale, poisoned, or incomplete evidence.
NIST AI RMFGOVERN — AI Governance and AccountabilityThe article is fundamentally about governing automated AI decisions in production.
Recommendation — Establish ownership, accountability, and review processes for AI security agent decisions.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsPer-user and per-repo permissions are central to preventing code leakage and overreach.
Recommendation — Apply authorization controls so the agent only accesses code and metadata the requester may see.
OWASP API Security Top 10API9 — Improper Inventory ManagementThe article describes finding resolution across scanners, repos, and workflows that must be consistently tracked.
Recommendation — Inventory the agent’s data sources and workflow endpoints so every finding resolves to a known system.

Key terms

  • Context Engineering: The practice of selecting, curating, and delivering the information an AI system uses at runtime. In agentic environments, context engineering is a security function because the quality, provenance, and trust level of the inputs directly shape the system’s actions and outputs.
  • Harness Engineering: Harness engineering is the set of systems around a model that make it reliable in production. It includes orchestration, retries, guardrails, observability, evaluation, and fallbacks, all of which determine whether the agent can be trusted at enterprise scale.
  • Evaluator Drift: The condition where an evaluation system no longer matches real operational quality or user satisfaction. It can happen when a judge model, heuristic, or rubric keeps scoring outputs well even as users begin rejecting them, creating false confidence in the programme.
  • Production Trust Boundary: The line between a convincing prototype and a governed operational system. For AI agents, this boundary is crossed only when access, evidence quality, auditability, and workflow controls are strong enough to support reliable automated decisions.

Deepen your knowledge

NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, agentic AI identity, machine identity security, IAM, and secrets management. It helps security and identity practitioners build the governance discipline needed for systems that act across code, access, and automation boundaries.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 1, 2026.
Updated on October 13, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org