harden_host
Host hardening: services, permissions, systemd, cron, umask, banners, USB control
This record as markdown: /tools/defense/harden-host.md
What harden_host does on Defense
AI agents use harden_host to create or update resources in Defense, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Defense environment.
| Parameter | Type | Required | Description |
|---|---|---|---|
mode | string | — | Octal permissions, e.g. '600' |
path | string | — | File or directory path |
group | string | — | File group, e.g. 'root' |
owner | string | — | File owner, e.g. 'root' |
scope | string | — | Permissions audit scope |
action | string | Yes | Action to perform |
dry_run | boolean | — | Preview changes |
service | string | — | Service name |
targets | array | — | Files to update for umask |
show_all | boolean | — | Show all services, not just flagged |
device_id | string | — | USB device ID in vendor:product format |
recursive | boolean | — | Apply recursively |
Parameters from the server's own tool schema.
Why harden_host is rated Medium
The tool creates or modifies system configurations (services, permissions, systemd, cron, umask, banners, USB control) which are reversible changes. While it affects security posture significantly, these modifications are not inherently destructive (can be undone/reverted) and do not execute arbitrary code or delete data.
From the tool's definition Tool performs host hardening via modifying services, permissions, systemd configurations, cron jobs, umask settings, and system banners—all of which involve creating or modifying system configurations and settings.
Risk signalsAccepts file system path (path) · High parameter count (21 properties)
Attacks that exploit this kind of access
The rule that runs harden_host safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Defense, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For harden_host, this is the rule to start with:
harden_host stays usable, but capped: an agent stuck in a loop can't make hundreds of changes a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Defense, apply this rule, and every harden_host call is checked against it from then on.
Questions about harden_host
Host hardening: services, permissions, systemd, cron, umask, banners, USB control. It is categorised as a Write tool in the Defense MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.
harden_host accepts 12 parameters: mode, path, group, owner, scope, action, dry_run, service, targets, show_all, device_id, recursive. Required: action. The full parameter table on this page comes from the server's own tool schema.
Register the Defense MCP server in PolicyLayer and add a rule for harden_host: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Defense. Nothing to install.
harden_host is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.
Yes. Add a rate_limit block to the harden_host rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for harden_host. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
harden_host is provided by the Defense MCP server (defense-mcp-server). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Defense, and thousands of servers like it.
This server
Across the catalogue