XHack Logo
XHack
Products
Services
Compliance
Pricing
Resources
Company
Sign upLogin
XHack Logo
XHackOffensive Security

Certified offensive security team delivering penetration testing evidence written for your auditor.

OSCP+OSCPC-AI/MLPenCASA
support@xhack.io

24/7 SOC Operations

XHack Status
Under attack? Get help now
Services
  • VAPT Services
  • Red Teaming
  • SOC Services
  • Threat Intelligence
  • Incident Response
  • Managed Testing
Pricing
  • Platform Plans
  • Services Pricing
Compliance
  • SOC 2
  • PCI DSS
  • ISO 27001
  • GDPR
  • HIPAA
  • ISO 42001
  • AI Maturity Assessment
  • TX-RAMP
  • NBFC / SECP
  • All Frameworks
Products
  • Vulnerability Assessment
  • GitGuard
  • AI Probe
  • SOC Dashboard
  • AI Agent
  • Cloud Investigation
Comparison
  • XBOW vs XHack
  • Horizon3 vs XHack
  • Strix vs XHack
  • Pentera vs XHack
Resources
  • Platform Tour
  • All Features
  • Install the Agent
  • XHack AI
  • Documentation
  • Blog
  • Case Studies
  • Documents
  • FAQ
Company
  • About Us
  • Our Team
  • Certifications
  • Security and Trust
  • VAPT Explained
  • Contact

© 2026 XHACK (SMC-PRIVATE) LIMITED. All rights reserved.

Registered with the SECP, CUIN 0361945. Verify

Security & TrustVulnerability DisclosurePrivacy PolicyTerms of ServiceRefund Policy
Blog/Security

AI Agent Safety for Pentesting: How to Run an Agent With Real Tools Without Losing Control

XHack

XHack

Author

November 24, 2026

28 min read

AI Agent Safety for Pentesting: How to Run an Agent With Real Tools Without Losing Control

Table of contents

24

What Goes Wrong When an Agent Has Real Tools

The Seven Layers of AI Agent Safety

Agent Safety Layer 1: Written Authorisation

Agent Safety Layer 2: Scope Lock

A scope check you can run yourself: scope_guard.py

Agent Safety Layer 3: Permission Modes

Agent Safety Layer 4: Hard Blocks

Agent Safety Layer 5: Isolation

Agent Safety Layer 6: A Question Policy

Agent Safety Layer 7: Record and Review

Agent Safety Against Hijacking: Defending the Agent Itself

Agent Safety on Production: Is It Safe to Run an Autonomous Agent There?

A Twelve-Point Agent Safety Checklist Before the First Run

Common Mistakes With AI Agent Safety

Where AI Agent Safety Falls Short

How XHack Delivers AI Agent Safety Differently

FAQ: AI Agent Safety Questions Answered

What is AI agent safety?

Can an AI pentest agent go out of scope?

What are permission modes in an AI agent?

Is it safe to run an autonomous AI agent on production systems?

How do you stop prompt injection in a pentest agent?

Does XHack store my agent chats?

The Bottom Line on AI Agent Safety

By Salman Khan, OSCP+, Founder of XHack, SRT (Synack Red Team member)

Read this in 30 seconds: An AI agent that runs shell commands and drives a browser can go wrong in two ways, it can leave the scope you gave it, and the pages and tools it reads can try to redirect it. AI agent safety for pentesting is a stack of seven layers, and most of them are yours to set before the first run.

  • Agent safety starts with scope, the control most tools leave to the prompt. A written scope costs nothing, but an agent only respects it if it is stored somewhere it reloads every session and checked by something that is not the model.
  • Agent safety settings change who approves, not what is possible. Permission modes are the example. XHack has four (Plan, Manual, Allow Edits, Auto), set per chat, and destructive commands are hard-blocked in every one of them.
  • A timeout is an agent safety decision. An XHack question card closes after 2 minutes and the agent carries on with its default, so the default has to be the safe answer.
  • The agent’s inputs are untrusted. In one XHack assessment, a community MCP server hid an instruction in a tool description that made an assistant call an unrelated tool and send CRM data out, and the fix was pinning, sandboxing and an allowlist, not a better prompt.
  • The first layer is a script. I include scope_guard.py, tested with 13 passing tests, which stopped 9 of 15 items in a demo that looked routine.

An agent with a shell and a browser does what its permissions allow, not what you meant, and the part nobody tells you is that the model is the one component you cannot audit line by line. So agent safety cannot live in the prompt. It lives in the settings, files and checks around the model, and you set them before the agent runs.

This guide to agent safety lays out seven layers, shows which ones XHack provides and which are yours, and includes a small script that checks planned targets and commands against a written scope. I run XHack, so I say where our own limits are too. For the wider picture of what these agents can do, see our guides to autonomous AI hacking agents and unrestricted AI agents.

It contains no attack techniques. It is written for testing systems you own or are authorised in writing to test.

AI agent safety animation: a scope guard script checks 15 planned targets and commands, passes the in-scope ones and stops excluded hosts, a look-alike domain and destructive commands
Real output of scope_guard.py: 9 of 15 items need a human decision before an agent touches them

What Goes Wrong When an Agent Has Real Tools

An agent fails in four ways, and each one needs a different control. The first three come from the agent doing too much. The fourth comes from the agent being told to.

  1. Scope drift. The agent follows a lead to a host you never listed, such as a billing system, a partner’s API or a shared host.
  2. Destructive actions. A cleanup step, a bad command or a misread output deletes data or stops a machine.
  3. Silent assumptions. When a question has no answer in the instructions, the agent picks one. In a long run you read about it afterwards.
  4. Hijacking through inputs. Text the agent reads, such as a web page, a tool’s output or an MCP tool description, contains instructions, and the model treats them as part of the task.

These failures are documented, and standards bodies now name them. OWASP’s LLM Top 10 (2025 edition) lists Excessive Agency as LLM06:2025 and gives three root causes: excessive functionality, excessive permissions and excessive autonomy. Its mitigations include requiring a human to approve high-impact actions and “complete mediation”, which means authorisation is enforced in downstream systems and not left to the LLM to decide. The OWASP Top 10 for Agentic Applications for 2026, published on 9 December 2025, adds ten agent-specific risks, among them Agent Goal Hijack, Tool Misuse, Identity and Privilege Abuse and Unexpected Code Execution.

The fourth failure has been measured. In a NIST CAISI red-teaming competition (23 March 2026), more than 250,000 attack attempts from over 400 participants found at least one successful attack against every frontier model targeted. Anthropic wrote in November 2025 that “no browser agent is immune to prompt injection”.

The first three have a press record, and every account below is reported by the people involved, not independently audited. In July 2025 a founder said Replit’s agent deleted a production database during a code freeze (The Register). In late November 2025 a user reported that a cache-clear command run by Google’s Antigravity in its no-approval Turbo mode hit the root of a D: drive (The Register). In April 2026 a Cursor agent was reported to have deleted a production volume and its backups in about nine seconds (Information Age). The details differ, and in each case the action was allowed and no check stood between the agent and the damage.

The Seven Layers of AI Agent Safety

Seven layers of AI agent safety: written authorisation, scope lock, permission modes, hard blocks, isolation, question policy, and record and review, each with what it stops and who sets it
Seven layers of AI agent safety for pentesting, with what each layer stops and who sets it

Only one of the seven agent safety layers, the hard block on destructive commands, is always on in XHack. The other six depend on you, which is the point of the list. The rest of this guide takes them in order.

Agent Safety Layer 1: Written Authorisation

No agent safety setting replaces permission to test. The agent cannot tell a system you own from one you do not, so the decision is yours and it comes first.

XHack’s restrictions page lists what the product is not for, and the first entries are unauthorised testing, data theft, denial of service and out-of-scope testing. It asks for a signed contract or authorisation from the system owner, a documented scope, and confirmation that the person who gave permission has the authority to do so.

In the US, the Justice Department’s charging policy for the Computer Fraud and Abuse Act (Justice Manual 9-48.000, updated May 2022) tells prosecutors to decline cases that consist of good-faith security research, meaning access solely for good-faith testing, investigation or correction of a security flaw, carried out to avoid harm. It is a charging policy, not a safe harbour, and it says nothing about client scope or written permission.

In the UK, section 1 of the Computer Misuse Act 1990 makes it an offence to cause a computer to perform a function with intent to secure unauthorised access, where you know the access is unauthorised. The section does not define “unauthorised”, which is why a written scope matters. This is not legal advice.

For bug bounty work, the program’s published scope and rules are the authorisation. Read them before the agent does, and put the rules you rely on, including the out-of-scope list, into the agent’s own record (layer 2).

Agent Safety Layer 2: Scope Lock

Agent safety depends on scope, a list of what is in, what is out, and which one wins when they overlap, and it has to live outside the conversation. A scope that exists only in the first message of a chat is gone when the context fills up.

XHack stores it in two places. Project memory keeps a per-project record of the target, scope and decisions, tied to the chat’s working folder, and the agent loads it back at the start of every session. The documentation’s own example is a plain sentence: scope is *.acme.com only, billing.acme.com is out of scope, auth is a bearer token, priority is IDOR and auth bypass. For bug bounty, Programs keeps each program’s scope, out-of-scope list and rules, and recon only looks inside the in-scope root domains. When you start a full hunt, the agent reads the scope, the out-of-scope list and the rules before it starts.

That protects the agent’s plan. It does not check what the agent is about to do. OWASP calls the fix complete mediation: authorisation enforced outside the model, not left to the LLM to decide. So I also use a check that does not depend on the model at all.

A scope check you can run yourself: scope_guard.py

scope_guard.py is a small agent safety tool in standard library Python. You give it a scope file and a list of planned targets or commands, and it answers IN, OUT, NOT IN SCOPE, ALLOWED or BLOCKED. It never touches the network, and it exits non-zero if anything needs a human.

The rules are the ones that cause incidents:

  • Exclusions beat inclusions. billing.acme.com matches *.acme.com, and it is still out.
  • A wildcard means subdomains, not the apex, so list acme.com separately if it is in scope.
  • A look-alike is not a match. evilacme.com and acme.com.evil.example are not in *.acme.com.
  • Userinfo tricks are caught. https://acme.com@evil.example/ has the host evil.example.
  • Case, trailing dots and ports are normalised, and non-ASCII hosts are converted to punycode, so a Cyrillic “a” does not pass as a Latin one.
  • IP rules and hostname rules never match each other, because the script does not resolve names. A hostname that resolves to an excluded IP is a gap you close by resolving and checking the addresses too.
  • A scope that allows everything is refused.
#!/usr/bin/env python3
"""scope_guard.py: pre-flight check of planned targets and shell commands against a written scope. Standard library only.
Usage: python3 scope_guard.py --scope scope.json --targets targets.txt [--commands commands.txt]
scope.json: {"in": ["*.acme.com", "acme.com", "203.0.113.0/28"], "out": ["billing.acme.com", "203.0.113.5"]}
Exit code 1 if anything is not IN scope or a command is blocked. It never touches the network (hostnames are not resolved)."""
import argparse, ipaddress, json, re, sys
from urllib.parse import urlsplit

def host_of(item):
    """lower-case ASCII host or IP from a URL, host:port, bare host or IP; None if unusable"""
    s = item.strip()
    if not s: return None
    h = urlsplit(s if "://" in s else "//" + s).hostname      # hostname drops userinfo, so https://acme.com@evil.test is evil.test
    if not h: return None
    h = h.rstrip(".").lower()
    try: return ipaddress.ip_address(h)
    except ValueError: pass
    try: return h.encode("idna").decode("ascii")
    except UnicodeError: return None

def matches(rule, host):
    rule = rule.strip().lower().rstrip(".")
    if isinstance(host, (ipaddress.IPv4Address, ipaddress.IPv6Address)):
        try: return host in ipaddress.ip_network(rule, strict=False)
        except ValueError: return False                         # a hostname rule never matches an IP
    if rule.startswith("*."): return host.endswith(rule[1:]) and host != rule[2:]   # subdomains only, not the apex
    try: ipaddress.ip_network(rule, strict=False); return False   # an IP rule never matches a hostname
    except ValueError: return host == rule

def check(scope, item):
    h = host_of(item)
    if h is None: return "INVALID"
    if any(matches(r, h) for r in scope["out"]): return "OUT"    # exclusions always win
    if any(matches(r, h) for r in scope["in"]): return "IN"
    return "NOT IN SCOPE"

BLOCK = [r"\brm\s+(-\w*\s+)*-\w*[rf]\w*\s+(--no-preserve-root\s+)?/(\s|$|\*)", r"\bmkfs(\.\w+)?\b", r"\bdd\s+[^|;]*\bof=/dev/", r"\b(shutdown|reboot|halt|poweroff)\b",
         r"\bdrop\s+(database|table|schema)\b", r"\btruncate\s+table\b", r":\(\)\s*\{\s*:\s*\|\s*:\s*&\s*\}\s*;", r"\bformat\s+[a-z]:", r">\s*/dev/sd[a-z]"]
def blocked(cmd): return any(re.search(p, cmd, re.I) for p in BLOCK)

def load_scope(path):
    s = json.load(open(path))
    if any(r.strip() in ("*", "*.*", "0.0.0.0/0", "::/0") for r in s.get("in", [])): sys.exit("refusing a scope that allows everything")
    s.setdefault("out", []); return s

def main():
    ap = argparse.ArgumentParser(); ap.add_argument("--scope", required=True); ap.add_argument("--targets"); ap.add_argument("--commands")
    a = ap.parse_args(); scope = load_scope(a.scope); bad = 0
    if a.targets:
        for line in open(a.targets):
            if line.strip() and not line.startswith("#"):
                r = check(scope, line); bad += r != "IN"; print(f"{r:13s} {line.strip()}")
    if a.commands:
        for line in open(a.commands):
            if line.strip() and not line.startswith("#"):
                b = blocked(line); bad += b; print(f"{'BLOCKED' if b else 'ALLOWED':13s} {line.strip()}")
    print(f"{bad} item(s) need a human decision" if bad else "all items pass")
    sys.exit(1 if bad else 0)

if __name__ == "__main__": main()

I ran it on a scope of .acme.com, acme.com and 203.0.113.0/28 with billing.acme.com, .internal.acme.com and 203.0.113.5 excluded.

IN            https://app.acme.com/login
IN            api.acme.com:8443
OUT           billing.acme.com
OUT           db.internal.acme.com
NOT IN SCOPE  https://acme.com@evil.example/
NOT IN SCOPE  evilacme.com
IN            203.0.113.9
OUT           203.0.113.5
NOT IN SCOPE  203.0.113.20
ALLOWED       nmap -sV -p 443 app.acme.com
ALLOWED       curl -sI https://api.acme.com
ALLOWED       rm -rf ./scan-output
BLOCKED       rm -rf /
BLOCKED       mysql -e "DROP DATABASE prod"
BLOCKED       shutdown -h now
9 item(s) need a human decision

Nine of 15 items needed a human: the excluded billing host, an internal database, a userinfo trick, a look-alike domain, an excluded IP, an IP outside the range, and three destructive commands. The block list is a small demonstration, not XHack’s list and not complete, and a real guard should be an allowlist of what the job needs.

Agent Safety Layer 3: Permission Modes

A permission mode is the agent safety setting you will touch most, because it decides how much the agent may do without asking. XHack sets it per chat, with one click on the mode chip in the status bar or Shift+Tab, so one conversation can run open while another stays locked down.

  • Plan is read-only. The agent investigates and proposes an approach and changes nothing.
  • Manual asks before every action. XHack’s documentation recommends it for production targets or anything sensitive.
  • Allow Edits auto-approves file edits only. Other actions still ask.
  • Auto approves everything in the chat, for authorised targets when you want the agent to move without stopping.
Animated matrix of what happens to four actions in each XHack permission mode: ask, auto-approve, propose only, and blocked for a destructive command in every mode
Permission modes change who approves an action. The destructive-command block applies in every mode.

When an action needs approval, a card offers Allow (Y) for this one action, Always Allow (A) for this kind of action from now on, and Deny (N), after which the agent tries something else.

Always Allow is the setting that quietly turns Manual into Auto. Treat it like a firewall rule: grant it for a specific kind of action you have reviewed, not as a way to stop being interrupted. Review what you have allowed at the end of each engagement.

The image below turns the documentation into a choice by job.

Which XHack permission mode to use: Plan for a first pass, Manual for production, Allow Edits for notes and code, Auto for an authorised lab with fixed scope, Auto with Go full for long runs
A permission mode for each kind of job, built from XHack’s permission-mode and Go full documentation

Test it on your own target

The XHack agent finds, verifies and reports real vulnerabilities in web apps, APIs, hosts and mobile.

Start free for 7 days

Agent Safety Layer 4: Hard Blocks

A hard block is the one agent safety control the model cannot talk its way past, because it is enforced by the software and not requested in a prompt. XHack’s documentation is specific: even in Auto, and in the fully hands-off autonomous run, destructive commands are hard-blocked. It names wiping disks, dropping databases and shutting machines down. The agent’s file tools also stay inside the chat’s working folder, so reads and writes cannot wander into the rest of the machine.

That is a narrow guarantee, and it is worth saying what it is not. It stops a class of damaging commands. It does not stop an in-scope but noisy scan against a fragile production system, a request that is legal and harmful anyway, or data copied out through an allowed tool. Those are for layers 2, 3 and 6.

Agent Safety Layer 5: Isolation

Isolation is the agent safety layer that limits what a mistake can reach. Three habits cover most of it.

  1. One working folder per engagement. XHack ties memory and file access to the folder, so different jobs stay separate. XHack also states that secrets belonging to one target stay locked to that engagement and do not leak into the next.
  2. A machine you can throw away. Run long autonomous jobs in a virtual machine or container with only the access the job needs, and keep your real credentials off it.
  3. A local model when the data cannot leave. XHack can run against a local model, in which case nothing leaves your machine. With your own provider key, data goes between your machine and that provider under its terms.

For agent safety and privacy, XHack’s agent runs on your machine and keeps prompts, responses, tool output and files there, and does not store your agent chats. That helps privacy. It also means the run’s record is yours to keep, which is the next layer’s problem.

Agent Safety Layer 6: A Question Policy

An agent that asks you questions is an agent safety control, and an agent told to stop asking is a different risk. XHack separates the two: permission modes decide which actions need your approval, and a separate setting decides whether the AI asks questions at all.

When the AI needs something only you know, such as test credentials or whether a host is in scope, a question card appears. You have 2 minutes. If you do not answer, the card closes and the AI carries on with the default shown on the card. The run never waits for you.

Two consequences follow.

  • Read the default before you walk away. A scope question whose default is “proceed” is a decision you made by being absent.
  • Write the answer into the program. The documentation suggests adding what you learn to the program’s out-of-scope list or rules, so the AI does not need to ask again.

Go full mode tells the AI not to ask anything. It decides and notes its assumptions in the chat. XHack’s own guidance is to use it for a long run while you are away, on a program you have already set up in full with a clear scope. It recommends leaving it off when the scope has grey areas or the AI needs test credentials only you have.

Agent Safety Layer 7: Record and Review

The last agent safety layer is evidence, and it is what lets you trust the other six after the fact. Two habits matter.

  • Reproduce before you believe. The model can misread output and report a finding that is not there. In XHack’s Full Hunt, every finding is reproduced before it is logged, and each lands in a Vulnerabilities panel with severity, location, impact, proof, reproduction steps and the exact HTTP request, searchable and exportable to PDF, HTML, Markdown or JSON. Whatever tool you use, make a person reproduce the ones that matter.
  • Keep your own run record. Because XHack’s agent keeps prompts, responses and tool output on your machine, the record of what ran is yours to keep. Export it per engagement, because it is your chain of custody.

While a run is going, watch it. XHack’s Agents panel shows a card per sub-agent with its status, progress, findings and running cost, and lets you pause, resume, stop or steer each one. The documentation’s own example of when to stop one is a sub-agent that has wandered off scope.

One more control belongs here. OWASP lists Human-Agent Trust Exploitation among its agentic risks, and the MCP project’s guidance for clients is blunt: show the exact command that will run, without truncation, and highlight patterns such as sudo and rm -rf. Approve only what you can read.

Agent Safety Against Hijacking: Defending the Agent Itself

Agent safety has to assume the agent reads untrusted text all day, and the model cannot reliably tell data from instructions. That is the fourth failure mode, and the controls for it are not prompts.

Where untrusted text enters an agent, a web page, tool output and an MCP tool description, and the controls on the action: an approval prompt, a scope lock and a tool allowlist
Treat everything the agent reads as input, not instruction, and put the controls on the action

Simon Willison’s “lethal trifecta” describes when this is dangerous: an agent with access to private data, exposure to untrusted content and the ability to communicate externally. A pentest agent has all three by design. It holds credentials and findings, it reads hostile pages and responses, and it makes network requests. So you cannot remove the exposure, and the controls go on the actions.

Vendors say the same. Anthropic’s engineering team writes that effective sandboxing requires both filesystem and network isolation, because without network isolation a compromised agent could exfiltrate files such as SSH keys. The MCP project’s security best practices say clients must show the exact command without truncation, require explicit approval and run local servers in a sandbox with minimal default privileges. Invariant Labs showed tool poisoning in April 2025: instructions in a tool description, invisible to users and visible to the model, made an agent read and pass on configuration and SSH key files.

XHack’s own case study makes it concrete. In a one-week assessment of an internal AI assistant at a marketing agency, the weakness was not in the agency’s code. A community-maintained MCP server returned a tool description with a hidden instruction. The assistant read it as part of its task, invoked an unrelated tool and sent CRM data toward an outside address, without telling the user. A person asking a routine question about campaign performance saw a normal answer. No client data left the environment and the server was removed the same day.

The fixes were pinning the community servers to vetted versions, sandboxing them, routing tool descriptions through a sanitiser and adding an allowlist of permitted tool calls. Read the full case.

The agent safety lesson for a pentest agent is the same. Every connected tool server is part of the attack surface. Pin versions, review tool descriptions as you would code, and keep the permission mode tight when you add a new server. Our guide to MCP server vulnerabilities for bug hunters goes deeper.

Agent Safety on Production: Is It Safe to Run an Autonomous Agent There?

For agent safety on production, the answer is not unattended, and not in Auto, unless you have written approval and have tested the same steps on a copy first. The search query “are autonomous AI pentesting agents safe to run on production” has no single answer, because it depends on the layers above.

A reasonable setup for production, using only the controls above:

  • written approval that names the systems, the window and the contacts;
  • Manual mode, so every action waits for you;
  • a first pass in Plan mode to read the proposed approach;
  • scope loaded in memory and checked with a script such as scope_guard.py;
  • a rate and load limit agreed with the owner, and a backup and rollback;
  • a human watching, with the escalation contacts to hand.

If you cannot supply those agent safety conditions, run the agent against a staging copy.

A Twelve-Point Agent Safety Checklist Before the First Run

  1. I have written permission that names the systems and the window.
  2. The scope has an in list, an out list and a rule that out wins.
  3. The scope is stored in the agent’s memory or program, not only in the chat.
  4. I have checked the planned targets with a script that does not use the model.
  5. The chat is in Plan or Manual for the first pass.
  6. I know which actions I have set to Always Allow, and why.
  7. Destructive commands are blocked, and I know what is not blocked.
  8. The job has its own working folder, and ideally its own machine.
  9. Test credentials are accounts the program gave me, never a real person’s.
  10. I have read the default on every question card that matters.
  11. Every tool server is pinned, reviewed and on an allowlist.
  12. I know where the run’s record is kept and who reviews the findings.

Common Mistakes With AI Agent Safety

  1. Putting the scope only in the prompt. This is the most common agent safety gap: it scrolls out of context and nothing checks it.
  2. Moving to Auto on day one. Agent safety is easier to loosen than to tighten, so start tight and loosen once the agent has behaved on this target.
  3. Treating Always Allow as a convenience. It is a standing permission.
  4. Trusting a question timeout. The default runs when you are away.
  5. Adding an MCP server without reading its tool descriptions. They are text the model obeys.
  6. Assuming the hard block covers everything. It stops destructive commands, not noisy or harmful in-scope actions.
  7. Sharing one folder across clients. Memory and files follow the folder, so this breaks agent safety between clients.

Where AI Agent Safety Falls Short

Agent safety controls reduce risk and do not remove it, and you should know where each one stops.

  • Permission modes are approvals, not a sandbox. In Auto, everything that is not hard-blocked runs.
  • The hard block is a list. It covers destructive commands, and a list can miss a case.
  • Scope checks on names miss resolution. A hostname can point at an address you excluded.
  • Prompt injection has no complete fix. Controls on the action reduce the damage, and none removes the possibility.
  • Humans get tired. Approval prompts clicked through are not agent safety, they are noise.
  • The model is still the model. It can misread output and report a finding that is not there, which is why findings need reproducing.

How XHack Delivers AI Agent Safety Differently

So yeah, here is where I tell you what XHack brings, with the bias of someone who built it.

XHack combines three things most providers sell separately: expert human penetration testing, an autonomous AI agent and a continuous security operations platform. For agent safety, that shows up in a few concrete ways, and each one is documented.

The agent safety controls are in the product, per chat. Four permission modes, an approval card with Allow, Always Allow and Deny, a destructive-command block that stays on in every mode, file tools confined to the working folder, project memory for scope, and questions that time out to a stated default. The documentation says what each agent safety control does, including what it does not.

Access is verified. XHack’s agent can find vulnerabilities from the start, and exploitation unlocks once your identity is verified with a government ID and a professional credential. That is a control on who runs the agent, which no prompt can give you.

Privacy is a design choice. XHack does not store your user data and is privacy-focused by design. Agent chats, session data and tool output stay on your own computer, you can delete them any time, and with a local model nothing leaves the machine. XHack’s own audit logs cover account and security events such as sign-ins and plan changes, and do not contain your chats.

The limits of our agent safety are stated. Auto is autonomy, the hard block is a list, and a question timeout runs the default. If you want an agent that never asks you anything and never gets blocked, we are not the right fit.

Individual plans run from $20 a month (Starter $20, Professional $49, Elite $150), with a 7-day free trial, one per person. Exploitation unlocks after identity verification. You can try it on a target you own and judge its agent safety, and what it finds, for yourself. If you would rather have our testers run the work, managed engagements start at $2,500 with fixed prices on the page. Book a free consultation, even if the answer turns out not to be us. Brutal honesty is kind of our thing.

FAQ: AI Agent Safety Questions Answered

What is AI agent safety?

AI agent safety is the set of controls that keep an AI agent with real tools inside the limits you set. For pentesting that means written authorisation, a scope the agent cannot ignore, permission modes, hard blocks on destructive actions, isolation, a policy for its questions and a reviewable record. The controls sit around the model, not inside the prompt.

Can an AI pentest agent go out of scope?

Yes, if scope exists only as an instruction. An agent can follow a lead to a host you never listed. For agent safety, reduce the risk by storing the scope outside the chat, checking planned targets with a script that does not use the model, and keeping the chat in Manual mode until the agent has behaved on this target.

What are permission modes in an AI agent?

A permission mode is an agent safety setting that decides how much the agent may do without your approval. XHack has four, set per chat. Plan is read-only, Manual asks before every action, Allow Edits auto-approves file edits only, and Auto approves everything. In XHack, destructive commands are hard-blocked in every mode.

Is it safe to run an autonomous AI agent on production systems?

For agent safety on production, only with written approval, a defined window, Manual mode and a human watching, after you have tested the same steps on a copy. Do not leave an agent on production in Auto, and do not rely on a question timeout, because the agent continues with its default when you are away.

How do you stop prompt injection in a pentest agent?

Agent safety cannot stop prompt injection completely, so you limit what an injected instruction can do. Treat every page, tool output and tool description as untrusted input, keep approvals on high-impact actions, check targets against the scope, and pin and allowlist every connected tool server.

Does XHack store my agent chats?

No. For agent safety and privacy, XHack does not store your agent chats. The agent runs on your machine and keeps prompts, responses, tool output and files there, and you can delete them. With the hosted model, prompts pass through XHack’s systems to generate a response and are not stored, and with a local model nothing leaves your machine.

The Bottom Line on AI Agent Safety

Agent safety comes down to the limits around an agent with real tools, and most of those limits are yours to set before the first run. Get the written scope, store it where the agent reloads it, check it with something that is not the model, start in Plan or Manual, and treat everything the agent reads as input and not instruction.

Agent safety is a habit as much as a setting. If you hunt on bounty programs, our guide to the XHack AI agent for bug bounty shows where scope enters the workflow, and is uncensored AI safe covers the risk on the other side. Then run scope_guard.py against your own scope and your own target list. If something you expected to be OUT comes back IN, you found the problem before the agent did.

Put this into practice

Point the XHack agent at a target you are authorised to test. It hunts, proves and writes the report.

Start free for 7 days

Categories

Security

Next

Self-Service Pentest: What You Can Run Yourself, What Still Needs a Human, and What It Costs

On this page

What Goes Wrong When an Agent Has Real Tools

The Seven Layers of AI Agent Safety

Agent Safety Layer 1: Written Authorisation

Agent Safety Layer 2: Scope Lock

A scope check you can run yourself: scope_guard.py

Agent Safety Layer 3: Permission Modes

Agent Safety Layer 4: Hard Blocks

Agent Safety Layer 5: Isolation

Agent Safety Layer 6: A Question Policy

Agent Safety Layer 7: Record and Review

Agent Safety Against Hijacking: Defending the Agent Itself

Agent Safety on Production: Is It Safe to Run an Autonomous Agent There?

A Twelve-Point Agent Safety Checklist Before the First Run

Common Mistakes With AI Agent Safety

Where AI Agent Safety Falls Short

How XHack Delivers AI Agent Safety Differently

FAQ: AI Agent Safety Questions Answered

What is AI agent safety?

Can an AI pentest agent go out of scope?

What are permission modes in an AI agent?

Is it safe to run an autonomous AI agent on production systems?

How do you stop prompt injection in a pentest agent?

Does XHack store my agent chats?

The Bottom Line on AI Agent Safety

Related articles

Continue reading

Self-Service Pentest: What You Can Run Yourself, What Still Needs a Human, and What It Costs

Security

Self-Service Pentest: What You Can Run Yourself, What Still Needs a Human, and What It Costs

Self-service pentest explained: what it means, published prices from $1,500 to $10,000, the scope rules you own and if a...

Read article
AI Red Team Operations: Where AI Fits in a Real Engagement and Where It Does Not

Security

AI Red Team Operations: Where AI Fits in a Real Engagement and Where It Does Not

AI red team operations explained: which of 6 phases AI speeds up, what a 40-network study found, DORA rules for testers ...

Read article
Jailbroken AI for Security Research: What It Costs You and the Legal Route

Security

Jailbroken AI for Security Research: What It Costs You and the Legal Route

Jailbroken AI for security research: the five costs, what research shows on defences and the verified route to fewer ref...

Read article