How We Defend Against AI Attackers

At Vulnetic we build software that tests other companies’ systems for vulnerabilities. We also run our own application and infrastructure, so we’ve had to work out how we would detect and stop someone running a hacking agent against us.

The tool we hear about most is ARTEX, an open-source pentesting framework that sends a team of AI agents at a target. Some of our customers have told us attackers used it against them. In November the FBI reported that attackers have used ARTEX since at least August 2026, and that some intrusions reached privileged access less than three hours after targeting began. The advisory also describes web directory fuzzing across more than 500 requests. A team that reviews access logs once a day would find that scan long after the attacker had moved on.

CERT-EU has seen several threat actors use ARTEX. It notes that the framework can test large numbers of low-complexity misconfigurations, including ones a human tester would notice but not have time to check. In practice this means the agent will hit your forgotten partner portal as thoroughly as your main app, and fewer people are watching the portal’s logs. CERT-EU recommends identifying internet-exposed assets, hunting logs for automated scanning patterns, and monitoring privileged account activity.

For a small team, the simplest place to start is the access logs your web server already writes.

Start with the routes people are already hitting

Give a coding agent a read-only, redacted sample of your access logs and ask it to group requests by source IP, sort each group’s paths by time, and include status codes. Scanners show up quickly this way. They request admin paths for software you don’t run, and the same list of paths appears from many IPs, so you can identify the scanner even after it switches addresses.

Claude Code or Codex can write this query and set it to run on a schedule, so you don’t need to buy a product for it. With the list of targeted routes, you can configure a WAF such as Cloudflare to rate-limit those endpoints or temporarily ban IPs that request known scanner paths. Run any new rule against normal traffic before turning it on.

Rate limits, CAPTCHAs, and email or phone verification still stop scanners. They do much less against an agent that behaves like a person. An agent can spend two days on one site, reading your public docs one day and following up on them the next. Sable works this way on our engagements, probing slowly for 48 hours or more, and at that rate its requests don’t stand out on a traffic graph. In one test, an AI SOC often classified Sable’s activity as benign (Evading an AI SOC with Sable). Detecting this kind of attacker means knowing which parts of your site a normal visitor never touches and alerting when something touches them.

A decoy route is a URL that no part of your application uses, placed where only someone reading your code would find it. A person clicking through the site never sees it. An agent that downloads your JavaScript bundles and greps them for API paths will.

Pick the path. Common paths like /.env, /wp-admin or /.git/config make good decoys if you don’t use them. Any request for them is a scanner or an attacker, and you can ban on the first hit. A path that exists only in your own bundle, such as /api/v1/internal/export?format=csv, catches something different: a request for it means someone read your code. Use both.

Plant the reference. Put the path in the bundle as a string next to real API calls, for example in an unused function or behind a feature flag that is always off. You can add the same path to a source map or an OpenAPI file if you publish one. Make it look like a forgotten internal feature, because those are what an agent tries first.

Answer like a real endpoint. Return a 401 with a JSON error saying an API key is required. A 404 tells the agent the path is dead and it moves on. A 401 suggests the endpoint is real and invites a second attempt. If you also put a fake API key in the bundle, an agent that finds both will send the key, and a request carrying that key is about as clear a signal as you can get. The handler should never touch real data or real auth code.

Alert and ban. Log every request to the decoy with the timestamp, source IP, user agent and headers. Before alerting on it, run your own link checkers and crawlers against the site and confirm none of them request it. After that, the handler can post to your on-call channel and add the source IP to a block list. On Cloudflare, a WAF custom rule can block requests by URL path, and the handler can add offending IPs to a list that another custom rule blocks. Ban by IP for a limited time, since agents rotate addresses and the next user of that IP may be legitimate.

Look backwards. The decoy hit is usually the end of a longer visit. Pull everything that IP requested in the previous days. Look for the reconnaissance that led up to it, such as docs pages, bundle downloads and login attempts. That history tells you what the attacker already knows about your app.

Put canaries on backend and development systems

Attackers don’t only come through the public app. A compromised dependency first runs on a developer laptop or a CI runner, where your WAF sees nothing. Supply chain malware goes straight for credentials once it’s there. The Shai-Hulud npm worm, for example, used a post-install script to fetch TruffleHog and harvest environment variables and cloud keys, targeting GitHub, npm, AWS and Google Cloud credentials. Its second wave went after the same credentials on CI/CD systems and developer workstations.

That behavior is what a canary catches. A canary is a credential that looks real, grants nothing, and alerts when someone uses it. Malware and attackers that steal credentials usually check whether they work, and that check fires the alert.

Where to put them. Put canaries where real secrets live:

- ~/.aws/credentials and .env files on developer machines - CI secrets, at both the organization and repository level - Environment variables on build runners - Config files on backend servers

Grafana Labs caught an intrusion this way. They had planted AWS key canaries in GitHub Secrets at the organization and repository level. An attacker exploited a vulnerable GitHub Action, stole secrets, and validated them with TruffleHog. That check used the canary key, which sent an immediate Slack alert and pointed them to the entry point.

Make them yourself. The free AWS keys from Canarytokens.org are easy to start with, but TruffleHog recognizes them by decoding the AWS account ID from the key and checking it against a list of known canary accounts, without ever calling AWS. An attacker using TruffleHog will skip them. Create your own instead: an IAM user with no permissions in a dedicated AWS account, with a CloudTrail and EventBridge rule that alerts whenever its key is used. Expect a delay of a few minutes, since alerts depend on CloudTrail delivery. Thinkst puts it at 2 to 30 minutes.

Label every one. Give each location its own key and record where it went. When an alert fires, you should know immediately whether it came from a specific laptop, a specific repository or a specific runner. In our own testing, prompt canaries (instructions written to trick the model) were tripped zero times, while decoy credentials and services caught the agent (Detecting Adversarial AI). Credentials work because the attacker has a reason to use them.

When one fires. If the canary on a build runner fires shortly after a dependency update, isolate that runner and save its build log. Then revoke every real credential that runner could read, not only the one that matched, since the malware took everything it found. Check the lockfile diff from that update to find the package. Then search your other runners and laptops for the same package version.

In Active Directory you can set the same kind of trap with a service account. Create an account named like an internal reporting service and register a unique service principal name (SPN) on it. The SPN is the name a client uses when it asks Kerberos for a ticket to a service. Give the account a long random password and ordinary domain user rights. Keep it out of privileged groups and scheduled tasks, and make sure the SPN maps to no real application. Nothing legitimate uses this service, so any ticket request for it needs investigating.

We tested this in our lab. After we removed the easy privilege-escalation path from a segmented AD environment, Sable searched more broadly and requested the decoy roastable service account (Detecting Adversarial AI).

That run also showed where decoys belong. With a clean ACL escalation path available, Sable took it and avoided the decoys. It only hit one after we removed that path and it had to try Kerberoasting and AS-REP roasting. Put decoys on the second- and third-best attack paths, because that is where an attacker goes once the obvious route is closed or watched.

The decoy SPN was one of several decoy identities in that lab. The others work the same way, and each catches a different technique:

- AS-REP roasting lure. A real account with no purpose and “Do not require Kerberos preauthentication” set. Anyone can request an AS-REP for it and crack the response offline, which is why attackers look for these accounts. The domain controller logs the request as event 4768 with pre-authentication type 0. Since nothing legitimate uses the account, any request is worth an alert. It also catches automated tools that request AS-REPs for every account they find. - Credentials for an account that doesn’t exist. Put a service account name and password in a file an attacker would read, such as a backup-validation script on SYSVOL or a departmental share. The account doesn’t exist, so the only way anyone tries it is by reading that file. Any authentication attempt using that name means someone read the file and is acting on it. - The file itself. Audit reads of that file. With a SACL on the file, local reads log event 4663. With Detailed File Share auditing on, reads over SMB log event 5145, which includes the source IP. Someone listing the share and seeing the filename tells you little. Someone opening the file is a stronger signal. - A disabled account with a credential in its description. Create a disabled object with a plausible display name and put another fake credential in its LDAP description field, where admins sometimes leave passwords. Directory access auditing with a SACL on the object logs reads as event 4662. This one is lower confidence on its own, since BloodHound-style collection and inventory tools read every description. The fake credential inside it is the real tripwire.

Rank alerts by what the attacker did, not by which decoy they touched. Discovery, such as listing a share or reading directory attributes, is often explained by legitimate tooling. Direct interaction, such as a ticket request or a login with a decoy credential, is much stronger. The strongest signal is an attacker using something they got from an earlier decoy, such as logging in with a credential they read from the monitored file. That sequence almost never happens by accident.

With Kerberos service ticket auditing enabled, the domain controller that handles the request logs event 4769. Forward those events from every domain controller and filter on the decoy account. The event includes the requesting account and client address. Any signed-in domain user can request a service ticket without the service account’s password, so if the request came from an employee’s laptop, check it against scheduled assessments and look at what ran on the laptop before isolating it.

Someone may also try to sign in as the decoy. A failed Kerberos pre-authentication can log event 4771 on a domain controller. A failed Windows logon can log 4625 on the machine where it was attempted, and a successful logon can log 4624. You need both domain controller and endpoint logs to trace the attempt back to a machine.

If the alert points to a VPN address, find which device held that address at the time and check its endpoint telemetry. Once you’ve tied the attempt to a workstation, quarantine it and review which real accounts were used on it. Don’t block the VPN address, since the next person assigned it would be cut off, and disabling the decoy does nothing about the compromised workstation. Before you turn on automatic quarantine, run a test from a designated machine and confirm the alert names that machine.

Each layer catches a different kind of attacker. Log analysis and WAF rules handle scanners, which are loud and fast. Decoy routes catch agents that read your code and probe slowly. Canaries catch malware that is already running on a laptop or build runner. Decoy SPNs catch someone already inside your domain. None of these needs a large team or budget, and coding agents do most of the setup work.

1. List every internet-facing site and service you run, including old partner portals, staging environments and anything a vendor set up for you. This is the first thing both the FBI and CERT-EU recommend, and it’s the list ARTEX-style tools work through. 2. Run the log analysis on all of them. Point Claude Code or Codex at a week of access logs from each site and have it build the scanner profile described above. Once the query exists, adding another site takes minutes, so there’s no reason to stop at your main app. 3. Get your initial WAF rules from a pentest. The best defenses are built from what an attacker would actually do against your site, and a pentest shows you exactly that: which endpoints it probes, which inputs it fuzzes, and which paths lead somewhere. Generic managed rule sets cover common attacks but know nothing about your application. Run a web pentest with Sable against each site and ask Sable to write WAF rules for what it found. Apply the rules, then run Sable again to confirm they block the attack paths without breaking normal use. Repeat when the site changes. Sable also runs internal network pentests and red team engagements, so you can use the same loop for network hardening: run Sable against your internal network, fix what it finds, add decoys along the paths it took, then run it again and check whether your fixes held and your decoys caught it. 4. Add decoy routes to each site’s JavaScript bundle, plus the common scanner paths you don’t use, with alerting and time-limited IP bans. 5. Plant canaries on developer machines, CI secrets and build runners, each labeled with its location. 6. If you run Active Directory, add a decoy SPN and forward 4769 events from every domain controller.

Then test every alert end to end. Have a teammate request each decoy from outside your network while signed out, use a canary key from a test machine, and request a ticket for the decoy SPN. For each one, check that the on-call person gets the alert and can trace it back to the request, machine or runner that caused it.