apply_template
Scaffold a new project from a template. Creates files and directories in the target path within the workspace. Safe — cannot write outside workspace root.
This record as markdown: /tools/7majesty-m-terminal-guardian-mcp/apply-template.md
What apply_template does on Terminal Guardian
AI agents use apply_template to create or update resources in Terminal Guardian, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Terminal Guardian environment.
Why apply_template is rated Medium
The tool creates files and directories, which are reversible write operations (files can be deleted). While scoped to a workspace root for safety, mass creation of files could consume disk space or interfere with existing project structures.
From the tool's definition Tool description states it 'Creates files and directories in the target path within the workspace.' This is explicitly a write operation that modifies the filesystem by creating new content.
Risk signalsAdmin/system-level operation
Attacks that exploit this kind of access
The rule that runs apply_template safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Terminal Guardian, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For apply_template, this is the rule to start with:
apply_template 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 Terminal Guardian, apply this rule, and every apply_template call is checked against it from then on.
Questions about apply_template
Scaffold a new project from a template. Creates files and directories in the target path within the workspace. Safe — cannot write outside workspace root. It is categorised as a Write tool in the Terminal Guardian MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.
Register the Terminal Guardian MCP server in PolicyLayer and add a rule for apply_template: 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 Terminal Guardian. Nothing to install.
apply_template 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 apply_template 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 apply_template. 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.
apply_template is provided by the Terminal Guardian MCP server (7majesty-m/terminal-guardian-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Terminal Guardian, and thousands of servers like it.
This server
Across the catalogue