ubuntu_execute_command
Execute a single validated command under an active security policy, with chaining and injection patterns blocked. Returns structured JSON results and flags output as untrusted text.
Instructions
Execute one validated command under the active security policy.
This tool is for controlled command execution. The command is parsed
with shlex, validated against allow/deny rules, and executed without
shell expansion in secure mode. Command chaining and injection patterns
(e.g., ;, &&, pipes) are blocked.
Args: command: Single command line string (no command chaining). working_dir: Optional directory; must be policy-allowed. detailed: If True, returns raw stdout/stderr payload; if False, returns compact summary fields.
Returns:
JSON string using unified contract:
- success: {"ok": true, "data": {...}}
- error: {"ok": false, "error": {"type", "message"}}
`data` includes command execution fields and `security_notice`
marking tool output as untrusted text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| detailed | No | ||
| working_dir | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |