Back to Intelligence

Prompt Adware in OpenAI Codex Jailbreak Kits: Detecting and Hardening Against the Haiou AI Agent Hijack

SA
Security Arsenal Team
November 4, 2026
11 min read

Check Point Research has disclosed a new threat class they call prompt adware: malicious payload bundles that tamper with the trusted instructions of AI coding agents to inject advertising for a third-party service. The specific campaign, dubbed Haiou (Chinese for "Seagull"), targets OpenAI Codex — the AI coding assistant used by developers to generate, review, and execute code inside real engineering environments.

The Haiou jailbreak bundle modifies Codex's configuration and instruction layer so that the agent, without the user's knowledge, inserts promotional content for a third-party AI gateway into its output. On the surface, that sounds like a nuisance. It is not. This is a compromise of the trust boundary between an AI agent and its operator, executed in an environment where the agent routinely holds source code access, API keys, cloud credentials, and in many workflows, the ability to execute commands on the host.

If an attacker can silently rewrite an agent's system instructions to serve ads today, the identical mechanism can redirect the agent's API traffic to a malicious gateway, exfiltrate prompts containing proprietary code and secrets, or instruct the agent to introduce vulnerable or backdoored code into your repositories. Every organization whose developers use Codex — or any agentic coding tool — should treat this as a supply-chain integrity incident class, not a marketing annoyance.

Technical Analysis

What Haiou Actually Does

Per Check Point Research's disclosure, the Haiou bundle operates as a jailbreak toolkit for OpenAI Codex with an embedded monetization motive:

  • Target: OpenAI Codex's local configuration and instruction context — the files and settings that define the agent's system-level behavior (e.g., the agent instructions/context files such as AGENTS.md, and the Codex configuration under ~/.codex/ including config.toml).
  • Mechanism: The bundle modifies the agent's trusted instruction set, injecting directives that cause the model to weave advertisements for a third-party AI gateway into its responses. Because these instructions are loaded as trusted context on every session, the tampering is persistent — it survives until the configuration is restored.
  • Distribution: The bundle is positioned as a "jailbreak" — tooling marketed to users who want to unlock or alter Codex behavior. This is the classic trojanized-tooling pattern: the victim runs the modifier voluntarily, granting it the access it needs to persist.
  • Monetization: Inserted content promotes a third-party AI gateway, suggesting an affiliate/traffic-redirection revenue model. Critically, a gateway redirection scheme means prompts — which routinely contain source code, internal hostnames, and credentials — could transit infrastructure the victim never consented to use.

Why This Is a Security Boundary Violation, Not Adware in the Classic Sense

Traditional adware monetizes screen real estate. Prompt adware monetizes the instruction channel of an autonomous agent. The defensive implications:

  1. Persistence via trust: Agent instruction files are rarely monitored, rarely versioned, and almost never covered by file integrity monitoring. A modification there is invisible to most EDR policies that focus on executables and script interpreters.
  2. Confused-deputy risk: Codex and similar agents operate with the developer's privileges and tokens. A hijacked instruction set can steer agent behavior — file reads, code suggestions, command execution — while every action logs as the legitimate user.
  3. Prompt exfiltration path: If the injected instructions steer the agent toward a third-party gateway, developer prompts and repository content may leave your trust boundary. Treat any unauthorized gateway endpoint found in agent configs as a potential data egress channel.
  4. Code integrity risk: An agent whose instructions have been altered cannot be trusted to produce unaltered code. Any code generated while tampering was active should be reviewed before merge.

Exploitation Status

  • CVE assignment: None. This is not a software vulnerability in Codex — it is abuse of the intended configurability of the agent's instruction layer. There is no patch to apply; the fix is integrity control and behavioral detection.
  • Status: Disclosed by Check Point Research as an observed, distributed jailbreak bundle (Haiou). The technique generalizes to any agent framework that loads local instruction/config files as trusted context.
  • CISA KEV: Not applicable — no CVE exists.

Affected Population

  • Developers running OpenAI Codex CLI/IDE integrations on macOS, Linux, and Windows workstations.
  • Any environment where developers install third-party "jailbreak," "unlock," or "optimizer" tooling for AI agents.
  • CI/CD or shared build environments where agent configurations are baked into images.

Detection & Response

The observable footprint of Haiou-style tampering is small but distinctive: unauthorized writes to agent instruction/config files, and network connections from agent processes to non-approved AI gateway endpoints. Those two primitives are highly detectable and low-noise in most environments.

Sigma Rules

YAML
---
title: Modification of OpenAI Codex Agent Configuration or Instructions
id: 3f8c1a42-7b6d-4e91-a2c5-haiou0001det
status: experimental
description: Detects writes or modifications to OpenAI Codex configuration and agent instruction files, consistent with Haiou prompt adware tampering of trusted agent instructions.
references:
  - https://thehackernews.com/2026/11/researchers-uncover-prompt-adware.html
  - https://attack.mitre.org/techniques/T1554/
author: Security Arsenal
date: 2026/11/10
tags:
  - attack.persistence
  - attack.t1554
  - attack.defense_evasion
logsource:
  category: file_event
  product: windows
detection:
  selection_path:
    TargetFilename|contains:
      - '\.codex\config'
      - '\.codex\instructions'
      - '\AGENTS.md'
      - '\.codex\auth.json'
  filter_ide:
    Image|endswith:
      - '\Code.exe'
      - '\codex.exe'
      - '\node.exe'
  condition: selection_path and not filter_ide
falsepositives:
  - Legitimate edits by developers or IDE extensions updating agent context
level: high
---
title: Codex Configuration Tampering on Linux and macOS
id: 3f8c1a42-7b6d-4e91-a2c5-haiou0002det
status: experimental
description: Detects shell-based modification of OpenAI Codex configuration or agent instruction files on Linux/macOS, consistent with Haiou jailbreak bundle behavior.
references:
  - https://thehackernews.com/2026/11/researchers-uncover-prompt-adware.html
  - https://attack.mitre.org/techniques/T1059/004/
author: Security Arsenal
date: 2026/11/10
tags:
  - attack.persistence
  - attack.t1059.004
logsource:
  category: process_creation
  product: linux
detection:
  selection_cmd:
    CommandLine|contains:
      - '.codex/config.toml'
      - '.codex/instructions'
      - 'AGENTS.md'
  selection_write:
    CommandLine|contains:
      - 'echo '
      - 'cat >'
      - 'sed -i'
      - 'tee '
      - 'curl '
      - 'wget '
  condition: selection_cmd and selection_write
falsepositives:
  - Developers legitimately editing agent configuration
  - Dotfile management frameworks (chezmoi, dotbot)
level: high
---
title: AI Agent Process Connecting to Non-Approved Gateway Endpoint
id: 3f8c1a42-7b6d-4e91-a2c5-haiou0003det
status: experimental
description: Detects Codex/agent-related processes establishing outbound connections to domains other than approved OpenAI endpoints, indicating possible gateway redirection via prompt adware.
references:
  - https://thehackernews.com/2026/11/researchers-uncover-prompt-adware.html
  - https://attack.mitre.org/techniques/T1071/001/
author: Security Arsenal
date: 2026/11/10
tags:
  - attack.command_and_control
  - attack.exfiltration
  - attack.t1071.001
logsource:
  category: network_connection
  product: windows
detection:
  selection_process:
    Image|endswith:
      - '\codex.exe'
      - '\node.exe'
  selection_port:
    DestinationPort:
      - 443
      - 8443
  filter_approved:
    DestinationHostname|endswith:
      - '.openai.com'
      - '.oaistatic.com'
      - '.oaiusercontent.com'
      - '.chatgpt.com'
  condition: selection_process and selection_port and not filter_approved
falsepositives:
  - Enterprise-approved AI proxies (add them to the allowlist explicitly)
  - Node.js processes used by other development tooling
level: medium

KQL — Microsoft Sentinel / Defender

This hunt query combines the two highest-fidelity signals: tampering with Codex instruction/config files, and agent processes communicating with non-OpenAI endpoints. Tune the approved domain list to your environment.

KQL — Microsoft Sentinel / Defender
// Hunt 1: File tampering with Codex agent configuration / instruction files
let approvedAIDomains = dynamic(["api.openai.com", "chatgpt.com", "oaistatic.com"]);
union isfuzzy=true
    (DeviceFileEvents
    | where FolderPath has_any (".codex", "AGENTS.md")
    | where FileName has_any ("config.toml", "instructions", "AGENTS.md", "auth.json")
    | where ActionType in ("FileCreated", "FileModified", "FileRenamed")
    | project Timestamp, DeviceName, InitiatingProcessAccountName, InitiatingProcessFileName, InitiatingProcessCommandLine, FolderPath, FileName, ActionType),
    (DeviceProcessEvents
    | where ProcessCommandLine has_any (".codex/config", "AGENTS.md")
      and ProcessCommandLine has_any ("curl", "wget", "echo", "sed -i", "tee ", "Out-File", "Set-Content")
    | project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine)
| sort by Timestamp desc;

// Hunt 2: Agent-related processes reaching non-approved AI endpoints (possible gateway redirection)
DeviceNetworkEvents
| where InitiatingProcessFileName in~ ("codex.exe", "codex", "node", "node.exe")
| where RemotePort in (443, 8443)
| where not (RemoteUrl has_any ("openai.com", "oaistatic.com", "oaiusercontent.com", "chatgpt.com"))
| where not (RemoteUrl has_any ("github.com", "npmjs.org", "microsoft.com"))  // remove common dev-tool noise; add your approved AI proxy here
| summarize FirstSeen=min(Timestamp), LastSeen=max(Timestamp), ConnectionCount=count(), DistinctEndpoints=dcount(RemoteUrl)
  by DeviceName, InitiatingProcessAccountName, InitiatingProcessFileName, RemoteUrl, RemoteIP
| where ConnectionCount > 5
| sort by FirstSeen desc;

Velociraptor VQL

Use this artifact to sweep a fleet for evidence of recent modification to Codex instruction/config files and to enumerate which processes hold handles or connections that suggest a redirected gateway.

VQL — Velociraptor
-- Hunt: Codex agent configuration tampering indicators
-- Collects Codex config/instruction file metadata and flags recently modified files,
-- plus any config.toml content referencing non-OpenAI base URLs or proxy endpoints.

LET config_files = SELECT FullPath, Size, Mtime, Btime
FROM glob(globs=['/**/.codex/config.toml', '/**/.codex/instructions*', '/**/AGENTS.md'],
          root='/Users')
WHERE Mtime > now() - 86400 * 30

LET config_content = SELECT FullPath,
       read_file(filename=FullPath, length=65536) AS Content
FROM glob(globs=['/**/.codex/config.toml'], root='/Users')
WHERE Content =~ '(?i)(base_url|api_base|proxy|gateway)'
   AND NOT Content =~ '(?i)api\.openai\.com'

LET linux_config = SELECT FullPath, Size, Mtime
FROM glob(globs=['/**/.codex/config.toml', '/**/AGENTS.md'], root='/home')
WHERE Mtime > now() - 86400 * 30

SELECT * FROM config_files
UNION ALL
SELECT FullPath, Size, Mtime, Btime FROM linux_config
VQL — Velociraptor
-- Hunt: agent processes with connections to non-OpenAI endpoints
SELECT Pid, Name, CommandLine, Exe, Username
FROM pslist()
WHERE Name =~ '(?i)(codex|node)'
  AND CommandLine =~ '(?i)(codex|openai)'

Remediation / Integrity Verification Script

Run this on developer workstations to audit Codex configuration integrity, flag unauthorized gateway redirection, and snapshot a known-good baseline.

PowerShell
#Requires -RunAsAdministrator
<#
.SYNOPSIS
    Audit OpenAI Codex configuration integrity for Haiou-style prompt adware tampering.
.DESCRIPTION
    1. Locates Codex config and agent instruction files for all local users.
    2. Flags configs referencing non-approved API base URLs / gateways.
    3. Reports files modified within the last 30 days by non-IDE processes (review manually).
    4. Creates a SHA256 baseline snapshot for future integrity comparison.
#>

$ApprovedEndpoints = @('api.openai.com', 'chatgpt.com')
$Report = @()

# Enumerate Codex config and instruction files across user profiles
$Targets = Get-ChildItem -Path 'C:\Users' -Recurse -Force -ErrorAction SilentlyContinue -Include 'config.toml','AGENTS.md','instructions.md' |
           Where-Object { $_.FullName -match '\.codex|AGENTS\.md' }

foreach ($file in $Targets) {
    $content = Get-Content -Path $file.FullName -Raw -ErrorAction SilentlyContinue
    $hash = (Get-FileHash -Path $file.FullName -Algorithm SHA256).Hash
    $recentlyModified = $file.LastWriteTime -gt (Get-Date).AddDays(-30)

    $suspiciousEndpoint = $false
    if ($content -match '(?i)(base_url|api_base|gateway|proxy)\s*=\s*["'']?https?://([^"''\s]+)') {
        $foundHost = $Matches[2]
        if (-not ($ApprovedEndpoints | Where-Object { $foundHost -like "*$_*" })) {
            $suspiciousEndpoint = $true
        }
    }

    $Report += [PSCustomObject]@{
        Path              = $file.FullName
        LastWriteTime     = $file.LastWriteTime
        RecentlyModified  = $recentlyModified
        SuspiciousGateway = $suspiciousEndpoint
        SHA256            = $hash
    }
}

$Report | Format-Table -AutoSize

# Write baseline snapshot for future comparison
$baselinePath = "$env:ProgramData\SecurityArsenal\codex_baseline_$(Get-Date -Format 'yyyyMMdd').json"
New-Item -ItemType Directory -Path (Split-Path $baselinePath) -Force | Out-Null
$Report | ConvertTo-Json | Out-File -FilePath $baselinePath -Encoding utf8
Write-Output "Baseline written to $baselinePath"

if ($Report | Where-Object { $_.SuspiciousGateway }) {
    Write-Warning 'ALERT: Codex configuration references a non-approved AI endpoint. Quarantine the config, review prompt history for data exposure, and re-image or reset the agent configuration from a known-good state.'
}

Remediation

Because Haiou abuses intended functionality rather than a patchable CVE, remediation is procedural and architectural:

  1. Reset compromised agent configurations immediately. Delete and regenerate ~/.codex/config.toml, any instruction files, and AGENTS.md from a known-good source. If the developer used a jailbreak bundle, treat the workstation as potentially compromised beyond the agent layer — the bundle executed with user privileges.
  2. Rotate credentials exposed to the agent. API keys, OpenAI tokens (~/.codex/auth.json), and any secrets present in repositories the agent accessed should be rotated if tampering is confirmed. Assume prompts transited the third-party gateway.
  3. Audit generated code. Any code produced or committed while tampering was active must be reviewed before merge or deployment. Diff agent-assisted commits from the exposure window.
  4. Establish file integrity monitoring on agent trust files. Add .codex/, AGENTS.md, and equivalent files for other agent frameworks (Cursor, Claude Code, Copilot Workspace) to FIM coverage. These files are now an attack surface.
  5. Enforce an AI egress allowlist. Permit developer workstations to reach only approved AI endpoints at the proxy or DNS layer. Alert on — and by default block — agent processes resolving unknown AI gateway domains. This kills the monetization and exfiltration channel simultaneously.
  6. Prohibit unvetted agent tooling. Update developer policy and technical controls to block installation of jailbreak/unlock bundles for AI agents. Treat them like cracked software: unverifiable provenance, elevated access, hostile economics.
  7. Add agent-configuration review to onboarding and image builds. Golden images that include pre-configured AI agents must have their instruction files checksummed and validated at deploy time.
  8. Monitor the threat class, not just this campaign. Check Point's "prompt adware" naming matters: expect copycat bundles targeting every major agent framework. The detections above generalize — extend them to the agent tools your developers actually run.

Executive Takeaways for Leadership

  • AI coding agents are now a target of supply-chain-style tampering, and their instruction files are an unmonitored persistence layer in most enterprises.
  • The blast radius of a hijacked agent includes source code, credentials, and the integrity of code merged into production — not just annoying ads.
  • The two controls with the highest immediate ROI: FIM on agent configuration files, and egress allowlisting to approved AI endpoints only.

Related Resources

Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.