In traditional cybersecurity, detection systems often act like a simple dictionary: they see a specific command or API call and look up whether it is "good" or "bad." However, in modern software environments, this approach fails because the most sensitive actions are inherently dual-use. A messaging app sending an SMS is a core feature; a calculator app sending an SMS is a security breach.
The research direction emerging across these papers is a shift from signature-based detection (what the code is) to context-aware behavioral analysis (why and how the code is acting). By incorporating functional categories, execution triggers, and structural relationships, researchers are building systems that can distinguish between legitimate administrative tasks and malicious exploitation.
The Semantic Gap in System Calls
The fundamental problem in security monitoring is "behavioral ambiguity." As noted by Zhaoqi Zhang and Panpan Qi in Dynamic Malware Analysis with Feature Engineering and Feature Learning, relying solely on API function names is insufficient. For example, the File.Write() command is used by both a ransomware strain encrypting your hard drive and a video editor saving a project.
To bridge this "semantic gap," researchers are enriching raw logs with three primary types of context:
- Argument Context: Analyzing the parameters of a call. Writing to a temporary folder is benign; writing to a system directory or a sensitive registry key is a high-risk indicator.
- Functional Context: Anchoring expectations to the software's purpose. Wenhao Fan and Fan Wu demonstrate in Android Malware Detection Based on Functional Classification that a sensitive permission (like location tracking) might be standard for a "Finance" or "Navigation" app but highly suspicious for a "Game."
- Trigger Context: Determining who started the action. Shao Yang and Xusheng Xiao argue in BinCtx: Multi-Modal Representation Learning for Robust Android App Behavior Detection that actions triggered by a background service are far more likely to be malicious than those initiated by a direct user click.
Modeling Intent through Graphs
Because context is relational, many researchers have moved away from linear log analysis toward graph-based representations. These models treat system entities (apps, APIs, files, network addresses) as nodes and their interactions as edges.
In Make Evasion Harder: An Intelligent Android Malware Detection System, Shifu Hou and Yanfang Ye introduce HinDroid, which uses Heterogeneous Information Networks (HINs). Instead of just looking at an API call, HinDroid looks at "meta-paths"—for example, "App A uses API 1, which is also used by App B (a known malware)." This structural context makes it much harder for attackers to evade detection by simply renaming functions or obfuscating code.
Similarly, for smart contracts, Kaihua Qin and Dawn Song developed Clue, which uses an Execution Property Graph (EPG). By unifying call traces and data dependencies into a single graph, Clue can detect complex DeFi exploits where the "maliciousness" of a transaction depends on external market states or oracle values that aren't visible in the code itself.
User-Awareness as a Security Filter
A recurring theme across the work of A. Sankara Narayanan and Yang Liu is the concept of user-awareness. In A Multi-view Context-aware Approach to Android Malware Detection and Malicious Code Localization, they propose labeling code blocks based on whether they are reachable through user-triggered events.
This creates a powerful heuristic: if a sensitive API (like one that exfiltrates data) is called while the user is interacting with a "Submit" button, it is likely benign. If the same API is called by a background process while the screen is off, it is flagged. This "contextual relabeling" significantly reduces the false positives that plague traditional tools, which often struggle to distinguish between a fitness app tracking a run and a stalkerware app tracking a victim.
Extending Context to Autonomous Agents
The need for context has become even more acute with the rise of LLM-enabled agents. As Derek Lilienthal and Sanghyun Hong demonstrate in Mind the Gap: Time-of-Check to Time-of-Use Vulnerabilities in LLM-Enabled Agents, static tool descriptions are not enough to prevent logic vulnerabilities.
Because autonomous agents use the same tools for both helpful tasks (deleting old files) and harmful ones (deleting system logs), security cannot be enforced by blocking specific actions. Instead, the system must evaluate the legitimacy of the instruction based on the user's original intent and specific organizational permissions. This moves the field toward "authorization frameworks" that treat every action as a request that must be validated against the current operational context.