Subscribe to the Non-Human & AI Identity Journal

What do security teams get wrong about in-memory execution risk?

They often focus on hiding files rather than controlling the decision path that creates the payload. In-memory execution matters because it reduces artefacts, but the deeper problem is that an agent can continuously adapt code to the target context. Governance has to cover the generation step, not only the delivery step.

Why This Matters for Security Teams

In-memory execution risk is often misunderstood as a stealth problem only, when it is also a control and governance problem. Security teams can over-invest in file-based detection and miss how payloads are assembled, modified, and launched at runtime. That matters because an agent, script, or loader can produce different behaviour on each execution, which weakens signature-based detection and complicates incident reconstruction.

This is where operational resilience and identity governance intersect. If a process, service account, API token, or non-human identity can invoke code generation or execution without tight boundaries, the attack surface expands beyond malware delivery into decision-making authority. The NIST Cybersecurity Framework 2.0 remains useful here because it forces teams to think in terms of identify, protect, detect, respond, and recover rather than only endpoint artefacts.

Practitioners also get tripped up by assuming that memory-only execution is always advanced tradecraft. In reality, it can be the result of ordinary administrative tools, automation, or approved software behaving in risky ways once trust boundaries are too loose. In practice, many security teams encounter in-memory execution only after detection gaps have already been exposed by lateral movement or privilege misuse rather than through intentional runtime governance.

How It Works in Practice

In-memory execution typically succeeds when an actor can move from a trusted entry point to runtime code assembly without enough inspection at the boundary. That may involve script interpreters, living-off-the-land tools, reflective loading, process injection, deserialisation, or agentic workflows that create and execute code on the fly. The key weakness is not just concealment, but the absence of controls over what is allowed to be generated, transformed, or executed in memory.

Security teams should think in layers:

  • Constrain who or what can initiate execution, especially privileged accounts and non-human identities.
  • Inspect the generation path, including scripts, prompts, orchestration logic, and remote content sources.
  • Use endpoint telemetry to observe suspicious process chains, memory access, and child process creation.
  • Correlate runtime events with identity context so anomalous privilege use is visible in SIEM and SOAR workflows.
  • Harden developer and automation environments so trusted tooling cannot become an uncontrolled execution bridge.

For teams handling autonomous workflows, the question is not only whether code lands on disk, but whether an agent or automation system is permitted to compose executable behaviour from external inputs. That is a security design issue as much as a detection issue. Guidance from the MITRE ATT&CK framework remains practical for mapping process injection, command execution, and credential misuse to observable techniques, while CISA guidance helps translate those techniques into hardening and response priorities.

Controls work best when runtime allowlisting, application control, and identity restrictions are enforced together. These controls tend to break down when cloud-hosted automation, developer workstations, or unmanaged agent frameworks can fetch content, spawn interpreters, and inherit broad permissions because the execution chain is no longer visible end to end.

Common Variations and Edge Cases

Tighter runtime control often increases operational overhead, requiring organisations to balance detection fidelity against engineering flexibility. That tradeoff becomes sharper in environments that rely on automation, CI/CD, serverless functions, or AI-assisted tooling, where legitimate ephemeral execution is common and rigid blocking can disrupt delivery.

Current guidance suggests treating in-memory execution differently across environments rather than assuming one blanket policy fits all. For example, a developer workstation, a production server, and an AI orchestration layer have different risk profiles. In some cases, the main exposure is not malware but trusted code that can be redirected through weak identity controls or overly permissive secrets access. This is especially important when a non-human identity can obtain tokens, query models, or trigger downstream actions without meaningful approval.

There is no universal standard for this yet, but best practice is evolving toward combining endpoint control, identity governance, and content validation. Teams should also be careful not to equate memory-only execution with invisibility. Good telemetry, kernel-level sensors, and identity-linked logging can still expose the chain of events. The main failure mode is assuming that because nothing touched disk, nothing was observable.

For broader governance, the NIST Cybersecurity Framework 2.0 and MITRE ATT&CK are complementary: one helps structure controls, the other helps map adversary behaviour. Where agentic systems are involved, security teams should also review the execution authority granted to the agent itself, not only the model output it produces.

Standards & Framework Alignment

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

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

Framework Control / Reference Relevance
NIST CSF 2.0 PR.AC-4 Least-privilege access limits who can trigger risky in-memory execution paths.
MITRE ATT&CK T1055 Process injection is a core in-memory execution technique relevant to this risk.
OWASP Agentic AI Top 10 Agentic systems can generate and execute code paths at runtime if not constrained.
NIST AI RMF AI risk governance should cover runtime generation and not just model outputs.

Restrict agent tool use, validate outputs, and prevent agents from self-assembling executable actions.