State-sponsored threat actors linked to China are now actively incorporating publicly available Artificial Intelligence (AI) tools into their cyber-espionage operations. A report from Hunt.io reveals that China-aligned Advanced Persistent Threat (APT) groups have been using Anthropic's Claude Code and DeepSeek as integral parts of their attack chain. These AI services were used to automate intrusions, generate malicious scripts, and execute commands against government targets in Thailand and Afghanistan, and financial institutions in Taiwan. This represents a tactical shift towards using legitimate, commercially available AI platforms as offensive tools. By 'living off the trusted service,' these APTs can better evade detection, as traffic to these AI platforms may be considered benign within a target's network. This development makes sophisticated threats more stealthy and effective.
The integration of public AI tools into state-sponsored attacks marks a significant evolution in APT methodology. Instead of relying solely on custom malware and infrastructure, these groups are now weaponizing dual-use technologies that may already be present and trusted within a target environment.
The observed workflow involved using the AI models for distinct purposes:
bash commands to be run on the compromised system.This division of labor allows the APT group to accelerate its operations, adapt to target environments on the fly, and reduce the need for hands-on-keyboard activity by human operators, thereby increasing stealth and scalability.
The core technique at play is a form of 'Living off the Land' but extended to cloud services: 'Living off the Trusted Service.' By routing their command generation and execution logic through legitimate AI APIs, the attackers' activities can be difficult to distinguish from normal developer or user activity.
MITRE ATT&CK Techniques:
T1071.001 - Web Protocols: The attackers use standard HTTPS traffic to communicate with the Claude and DeepSeek APIs for command and control.T1105 - Ingress Tool Transfer: The AI-generated scripts and payloads are downloaded to the victim machine.T1059.004 - Unix Shell: Claude Code was used to generate and execute bash commands.T1588.006 - Web Services: The attackers are acquiring and using web-based AI services as part of their operational toolkit.This tactic is particularly insidious because it abuses the trust that organizations place in popular AI services. Security teams may have allow-listed traffic to anthropic.com or other AI providers, inadvertently creating a covert channel for APT command and control.
This trend is consistent with a broader increase in APT activity. A separate report from NSFOCUS noted a continuous rise in global APT operations in 2025, with 42 new groups identified. The integration of AI is seen as a key factor making these groups more dangerous.
The use of public AI tools by APTs has several critical impacts:
No specific Indicators of Compromise (IOCs) were provided in the source articles.
Defending against this tactic requires a shift in mindset from blocking known-bad to detecting anomalous-good.
bash script. The correlation of events is key. (D3FEND: Process Analysis)M1035 - Limit Access to Resource Over Network)M1020 - SSL/TLS Inspection)M1038 - Execution Prevention)Filter and inspect egress traffic, even to trusted AI services, to detect anomalous API calls or data flows.
Mapped D3FEND Techniques:
Implement SSL/TLS inspection to gain visibility into the content of API calls to external web services.
Mapped D3FEND Techniques:
Use application control to prevent the execution of malicious scripts generated by AI tools.
Mapped D3FEND Techniques:
To counter APTs abusing trusted AI services, organizations must evolve their egress filtering strategy. It is no longer sufficient to simply allowlist traffic to domains like api.anthropic.com. Instead, a more granular policy is required. All outbound API calls to AI services should be routed through a dedicated, inspecting web proxy. Policies should be configured to only allow such traffic from specific, authorized sources (e.g., developer subnets) and deny it from server segments or general user networks. Furthermore, enabling SSL/TLS inspection on this traffic allows for deeper analysis of the API requests and responses, enabling detection of suspicious queries or payloads being sent to or received from the AI model. This turns a trusted channel into a monitored chokepoint.
Defenders should use EDR solutions to focus on the full chain of process events rather than a single indicator. In the context of this APT activity, a high-fidelity detection rule would correlate multiple events: 1) A process (e.g., curl or a Python script) makes an outbound network connection to a known AI API endpoint. 2) The same process or its child process then immediately executes a shell command (e.g., via bash -c) or writes a new script to disk. This sequence is highly indicative of an attacker using an AI service for command generation. By baselining normal developer workflows, security teams can tune these rules to identify when this pattern occurs outside of an expected context, such as on a production server or from a non-developer user account.

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.
CyberNetSec.io uses automation to assist source monitoring, deduplication, observable extraction, and structured intelligence generation. Published analysis follows human-defined editorial standards and adds defensive context including MITRE ATT&CK, D3FEND, STIX, and Sigma where applicable. Read our editorial policy.
Help others stay informed about cybersecurity threats
Every tactic, technique, and sub-technique used in this threat has been identified and mapped to the MITRE ATT&CK framework for consistent, actionable threat language.
Observables and indicators of compromise (IOCs) have been extracted and cataloged. Risk has been assessed and correlated with known threat actors and historical campaigns.
Detection rules, incident response steps, and D3FEND-aligned mitigation strategies are included so your team can act on this intelligence immediately.
Structured threat data is packaged as a STIX 2.1 bundle and can be visualized as an interactive graph — relationships between actors, malware, techniques, and indicators.
Sigma detection rules are derived from the threat techniques in this article and can be converted for deployment across any major SIEM or EDR platform.