A Secure Agentic AI Framework for Autonomous Cyber Threat Detection, Reasoning, and Response

 A Secure Agentic AI Framework for Autonomous Cyber Threat Detection, Reasoning, and Response

Abstract

The increasing integration of large language models (LLMs) with external tools, APIs, databases, and autonomous workflows has introduced a new class of cybersecurity challenges in which attacks can influence not only model outputs but also the actions performed by intelligent agents. Conventional intrusion detection systems primarily analyze network, host, or application telemetry and may therefore overlook attacks that emerge through multi-step agent trajectories, indirect prompt injection, tool misuse, memory manipulation, privilege escalation, and coordinated inter-agent behavior. This paper proposes a Secure Agentic AI Framework (SAAF) for autonomous cyber threat detection, reasoning, and response. The framework integrates heterogeneous telemetry, machine-learning-based anomaly detection, temporal and graph-based correlation, bounded LLM reasoning, explainable evidence generation, risk-aware policy enforcement, and controlled autonomous response within a unified security architecture. Rather than allowing an LLM to independently authorize high-impact actions, SAAF separates probabilistic reasoning from deterministic policy enforcement. Agent observations are converted into structured security events, evaluated by complementary detection mechanisms, correlated into attack hypotheses, interpreted through evidence-constrained reasoning, and passed to a policy layer that determines whether an action should be allowed, restricted, verified, blocked, or isolated. The framework additionally defines an evaluation methodology covering detection effectiveness, false-positive behavior, explanation quality, response safety, latency, robustness to adversarial manipulation, and adaptation under distribution shift. Public agent-security benchmarks such as AgentDojo, InjecAgent, and AgentHarm provide foundations for future empirical validation. The proposed framework is intended as a research architecture rather than a claim of experimentally demonstrated superiority; therefore, no unsupported performance results are reported.

Index Terms— Agentic AI, cybersecurity, LLM security, threat detection, autonomous response.

I. INTRODUCTION

Artificial intelligence systems are increasingly moving beyond conventional prediction and generation toward agentic architectures capable of interpreting objectives, planning actions, invoking external tools, accessing information sources, and modifying their behavior according to environmental feedback. This transition creates a fundamentally different cybersecurity boundary. In a conventional machine-learning application, an incorrect prediction may remain an informational error. In an agentic system, however, the same model output can be translated into a database operation, API request, file modification, command execution, or communication with another software agent.

The security implications become particularly significant when language models are connected to external tools and untrusted information sources. Modern agent architectures can retrieve documents, process emails, inspect websites, call APIs, query databases, and use software tools. Consequently, malicious instructions may enter an agent indirectly through content that appears to be legitimate. The InjecAgent benchmark demonstrates this risk by evaluating indirect prompt injection against tool-integrated LLM agents across 1,054 test cases involving 17 user tools and 62 attacker tools.

Recent agent-security research has also expanded beyond prompt injection. AgentHarm evaluates malicious multi-step agent tasks and highlights that agent safety must consider whether an agent can maintain harmful capabilities across a sequence of actions rather than merely whether it generates an unsafe response. AgentDojo similarly provides a dynamic environment for evaluating prompt-injection attacks and defenses in LLM agents.

Traditional intrusion detection systems nevertheless remain an important foundation. Signature-based techniques can identify known attack patterns, whereas anomaly-based approaches attempt to detect deviations from learned behavioral baselines. Hybrid systems combine multiple sources of evidence. The limitation is that agentic attacks may not be represented by a single malicious event. Instead, an attack can emerge from a sequence such as:

retrieval → injected instruction → altered reasoning → unusual tool selection → privilege escalation → sensitive resource access.

Therefore, evaluating each event independently may fail to capture the security significance of the complete trajectory.

The uploaded SAAF manuscript already identifies this limitation and proposes extending conventional security monitoring to include prompts, tool calls, tool outputs, identity context, memory operations, inter-agent communication, and action outcomes.

A. Research Problem

The central problem addressed in this study is:

How can an AI-agent security architecture combine heterogeneous telemetry, machine-learning detection, semantic reasoning, explainability, policy enforcement, and controlled autonomous response without allowing probabilistic language-model behavior to directly authorize high-impact actions?

This problem contains several related challenges:

  1. Heterogeneous telemetry: security-relevant information exists across prompts, network events, tool calls, APIs, databases, identity systems, memory stores, and agent messages.
  2. Multi-step attacks: individual events may appear legitimate while their temporal combination indicates malicious intent.
  3. Semantic manipulation: indirect prompt injection can alter agent behavior through externally retrieved content.
  4. Tool misuse: an agent may possess legitimate access to a tool while using it outside its intended security context.
  5. Explainability: security decisions require evidence that analysts can inspect rather than unsupported natural-language explanations.
  6. Autonomous response: automated actions must be constrained by explicit security policies.
  7. Adaptation: continual learning can improve detection but may itself introduce poisoning and manipulation risks.

B. Research Gap

Existing research provides important individual components for this problem: intrusion detection, anomaly detection, LLM agents, prompt-injection benchmarks, explainable AI, threat intelligence, and policy-based security. However, these components are frequently evaluated independently.

The research gap addressed by SAAF is therefore architectural integration. The framework combines detection, temporal correlation, semantic reasoning, explanation, risk assessment, policy enforcement, response, and controlled learning within a single security pipeline.

C. Contributions

This paper makes five primary contributions:

  1. Threat-oriented agent telemetry model: integrates prompts, observations, tool calls, tool outputs, identity information, memory operations, and action outcomes.
  2. Secure Agentic AI Framework: proposes an Observe–Detect–Correlate–Explain–Decide–Respond–Learn architecture.
  3. Risk-aware decision mechanism: combines statistical evidence, temporal context, privilege sensitivity, resource criticality, and policy constraints.
  4. Evidence-constrained reasoning: positions the LLM as a semantic reasoning component rather than an unrestricted authorization mechanism.
  5. Reproducible evaluation methodology: defines metrics for detection, false alarms, explanation quality, response safety, latency, robustness, and adaptation without fabricating experimental results.

II. RELATED WORK

A. Conventional Cyber Threat Detection

Cybersecurity detection has traditionally relied on signature-based, anomaly-based, and hybrid approaches. Signature-based systems are effective when attack characteristics are already known, while anomaly detection attempts to identify deviations from expected behavior. Machine-learning approaches have subsequently expanded detection capabilities through supervised classification, clustering, ensemble learning, and representation learning.

However, conventional detection commonly treats security telemetry as a collection of events. Agentic systems require a broader representation because the meaning of an event may depend on the preceding reasoning state, user identity, tool authorization, resource sensitivity, and subsequent actions.

B. LLM-Based Agents

Agentic LLM research has demonstrated how language models can combine reasoning with external actions. ReAct introduced an interaction pattern in which reasoning and acting are interleaved, providing a foundation for tool-using agents. Toolformer investigated models learning to invoke external tools, while ToolLLM explored large-scale API use.

These approaches improve agent capabilities but simultaneously enlarge the attack surface. Once an LLM can select and invoke tools, the security problem becomes partially a problem of action authorization, not merely text generation.

C. Prompt Injection and Agent Security

Prompt injection is particularly important because the malicious instruction does not necessarily have to originate from the user. An agent may encounter attacker-controlled content while browsing a website, reading an email, retrieving a document, or processing tool output.

InjecAgent provides a dedicated benchmark for this problem and documents the vulnerability of tool-integrated agents to indirect prompt injection.

AgentDojo extends this line of research by providing a dynamic environment for evaluating attacks and defenses against LLM agents.

AgentHarm addresses another dimension: harmful multi-step agent behavior. Its benchmark contains malicious agent tasks across multiple harm categories, demonstrating why agent security evaluation should consider complete task execution rather than isolated outputs.

D. Explainable AI for Security

Security systems increasingly require explanations because analysts need to understand why an event was classified as suspicious. Methods such as LIME and SHAP provide mechanisms for interpreting model predictions.

SAAF extends this principle by requiring explanations to remain connected to structured security evidence. An LLM-generated explanation alone is not considered sufficient evidence. Instead, explanations should identify the telemetry, behavioral deviation, temporal relationship, privilege context, and policy condition that contributed to the decision.

Table I — Research Gap Across Existing Approaches

Approach

Detection

Agent trajectory

LLM reasoning

Tool security

Explainability

Autonomous response

Traditional IDS

✓

Limited

—

Limited

Limited

Limited

ML anomaly detection

✓

Partial

—

Limited

Partial

Limited

LLM agents

—

✓

✓

✓

Partial

✓

Prompt-injection benchmarks

—

✓

✓

✓

Limited

—

Agent-security benchmarks

Partial

✓

✓

✓

Partial

Partial

SAAF

✓

✓

✓

✓

✓

✓

The table represents the architectural scope of the approaches rather than a performance ranking.

III. PROPOSED METHODOLOGY

A. Overall Architecture

SAAF follows a seven-stage security pipeline:

Observe → Detect → Correlate → Explain → Decide → Respond → Learn

The uploaded manuscript already establishes this modular structure and separates LLM reasoning from explicit policy enforcement.

Figure 1 — SAAF Overall Architecture



B. Security Telemetry Representation

Each agent interaction is represented as a structured event:



where:

  • = user or identity,
  • = agent,
  • = requested resource,
  • = input or instruction,
  • = tool/context information,
  • = observed outcome,
  • = applicable policy,
  • = timestamp.

This representation allows the framework to correlate events that would otherwise appear independent.


C. Detection Layer

The detection layer combines multiple signals instead of depending on a single classifier.

Let:



where:

  • = signature evidence,
  • = anomaly score,
  • = temporal deviation,
  • = graph/relationship anomaly,
  • = calibrated weights.

The resulting score is normalized to:



A high score does not automatically mean that the action is malicious. It triggers further correlation and reasoning.


D. Temporal Correlation

A major distinction of SAAF is that it evaluates sequences rather than isolated events.

For a trajectory:



the framework evaluates whether the combined sequence indicates an attack objective.

For example:



may represent a stronger security signal than any individual event.


E. Evidence-Constrained LLM Reasoning

The LLM is responsible for semantic interpretation rather than final authorization.

Its input is:



where:

  • = detection evidence,
  • = temporal context,
  • = relationship information,
  • = policy context,
  • = identity and privilege information.

The reasoning layer produces an attack hypothesis:



However:



This distinction is central to SAAF.

The LLM can recommend:

  • investigate,
  • restrict,
  • verify,
  • block,
  • isolate,

but the final action is determined by the policy engine.


IV. RISK-AWARE DECISION AND RESPONSE

A combined risk score can be represented as:



where:

  • = detection confidence,
  • = correlation strength,
  • = privilege sensitivity,
  • = resource criticality,
  • = action impact.

The response policy then maps risk into controlled actions.

Risk level

Example response

Low

Allow + monitor

Moderate

Allow with additional verification

High

Restrict / require human approval

Critical

Block + isolate + alert

This is deliberately not a fully autonomous “LLM decides everything” architecture.

V. SECURITY THREAT MODEL

SAAF considers attacks against both the agent and the security framework itself.

Figure 2 — Agentic AI Threat Surface


The principal threat categories are:

  1. Direct prompt manipulation
  2. Indirect prompt injection
  3. Tool misuse
  4. Privilege escalation
  5. Memory/context poisoning
  6. Data exfiltration
  7. Adversarial inputs
  8. Inter-agent manipulation
  9. Detector evasion
  10. Learning-data poisoning

The framework therefore treats its own detection and learning mechanisms as potential attack surfaces.

VI. EVALUATION METHODOLOGY

Because the present manuscript does not contain completed SAAF prototype measurements, this section defines the evaluation methodology rather than inventing results.

Datasets / benchmarks

Future empirical validation can combine conventional cybersecurity datasets with agent-security benchmarks, including:

  • CICIDS2017
  • CSE-CIC-IDS2018
  • UNSW-NB15
  • Bot-IoT
  • TON_IoT
  • Edge-IIoTset
  • AgentDojo
  • InjecAgent
  • AgentHarm

AgentDojo is specifically designed for dynamic evaluation of attacks and defenses for LLM agents, while InjecAgent provides a benchmark focused on indirect prompt injection. AgentHarm adds evaluation of malicious multi-step agent behavior.

Evaluation metrics

Dimension

Metrics

Detection

Precision, Recall, F1, PR-AUC

False alarms

False-positive rate

Security

Unsafe-action rate

Response

Block/restrict accuracy

Explainability

Evidence-grounded explanation score

Efficiency

Detection latency

Adaptation

Performance under distribution shift

Robustness

Attack success rate

Operations

Human-review rate

Important: actual numerical values will only be added after experiments are genuinely performed.

VII. EXPECTED RESULTS AND DISCUSSION

SAAF is expected to provide a broader security representation than an isolated event classifier because its decision process incorporates temporal context, identity, tool permissions, resource criticality, and policy constraints.

However, this paper does not claim that SAAF has achieved a particular accuracy, F1 score, latency, or attack-blocking rate. Such values require an implemented prototype and reproducible experiments.

The framework also introduces trade-offs. LLM reasoning can increase semantic coverage but may increase computational cost and latency. Graph-based correlation can improve contextual analysis but may become expensive in large environments. Continual learning can address distribution shift but creates additional poisoning and governance risks. These limitations are already recognized in the underlying SAAF manuscript.

 

VIII. CONCLUSION

This paper presented SAAF, a Secure Agentic AI Framework for autonomous cyber threat detection, reasoning, and response. The framework extends conventional security monitoring by incorporating agent-specific telemetry, temporal correlation, explainable evidence, bounded LLM reasoning, risk-aware policy enforcement, controlled response, and security-aware adaptation.

The principal architectural principle is the separation of reasoning from authorization. An LLM can interpret heterogeneous evidence and generate an attack hypothesis, but high-impact actions remain subject to explicit policy controls. This design reduces the risk of treating probabilistic language-model output as an independent security authority.

Future implementation should evaluate SAAF using both conventional intrusion-detection datasets and emerging agent-security benchmarks such as AgentDojo, InjecAgent, and AgentHarm.

The current paper therefore presents a research framework and evaluation methodology, not fabricated empirical superiority. The next publication stage is the rigorous reference audit and final manuscript formatting.

 

Post a Comment

Previous Post Next Post