Draft Security Guardrails for AGENTS.md Configuration

Generate a robust security policy for AGENTS.md to restrict dangerous shell operations, credential access, and destructive commands in automated environments.

Agent prompt for ChatGPT

Prompt

Prompt
Act as a Senior Security Engineer. Draft a security guardrails section for an AGENTS.md file that restricts autonomous agents from performing high-risk operations. Follow these rules: 1. List specific prohibited CLI flags for common tools like rm, git, and npm. 2. Define strict environment variable access controls to prevent secret exposure. 3. Prohibit network-level package installations that bypass verified registries. 4. Use clear, imperative language suitable for both human auditors and LLM-based autonomous systems. 5. Include a specific prohibition against modifying system-level configuration files. Output format: 1. Prohibited CLI Commands and Flags. 2. Environment Variable Access Restrictions. 3. Network and Package Installation Policies. 4. System File Protection Rules. This prompt is for security configuration guidance only and does not constitute a comprehensive security audit; consult a cybersecurity expert to verify your final implementation.

Example output

Example for: a Python-based autonomous agent managing a production repository.

1. Prohibited CLI Commands and Flags
  • rm: Prohibit the -rf flag on all directories outside of /tmp/sandbox.
  • git: Prohibit push --force or reset --hard on the main branch.
  • npm: Prohibit global installs (-g) and scripts that execute post-install hooks.
  • curl/wget: Prohibit piping output directly into shell interpreters (e.g., | sh).
2. Environment Variable Access Restrictions
  • Agents must not access variables prefixed with AUTH_, SECRET_, or API_KEY_.
  • Access to process.env is restricted to read-only mode for non-sensitive configuration keys.
  • Logging or printing any environment variables to stdout or logs is strictly forbidden.
3. Network and Package Installation Policies
  • All package installations must be sourced from the internal corporate proxy registry.
  • Direct connection to npmjs.com or pypi.org is blocked at the network level.
  • Agents may not initiate outbound connections to unknown IP addresses or unauthorized domains.
4. System File Protection Rules
  • Agents are prohibited from modifying /etc/, /usr/bin/, or any hidden dotfiles in the user home directory.
  • Modification of .ssh/authorized_keys or .git/config is strictly forbidden.
  • Any attempt to overwrite system binaries will trigger an immediate termination of the agent process.

This is not professional security advice; consult a qualified cybersecurity professional for your specific infrastructure needs.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Categorizes restrictions into logical security domains for easy parsing.
  • Uses imperative language to enforce strict compliance for both humans and AI.
  • Includes a specific disclaimer regarding the scope of security guidance.

Use this prompt when setting up an AGENTS.md file for an autonomous repository or agent framework. Paste the output directly into your documentation. Compatible with ChatGPT, Claude, and GitHub Copilot.

Common edits

  • Add specific internal domain names to the network policy section.
  • Adjust the prohibited CLI flag list based on the specific language runtime used.

Reuse it: Use in a workflowAdapt in the builder

Prompt details

By
Prompts-GPT editors
Published
How prompts are written and checked

Did this prompt work?

More in Codex
AI Coding AgentsClaude Code

Design a Sandbox Security Policy for Autonomous Coding Agents

Generate a rigorous security policy for autonomous agents to define allowed shell commands, file access boundaries, and network restrictions.

Automated Dependency Upgrade and Rollback Protocol

Generate a safe, step-by-step dependency upgrade plan that includes strict semver validation, lockfile parity checks, and automated rollback triggers.

AI Coding AgentsClaude Code

Create Automated Verification Loops for Long-Running Coding Agents

Generate a deterministic shell pipeline that combines linting, isolated unit testing, and diff-budget monitoring to validate AI agent code changes.

Sales

Draft Technical Security and Compliance Questionnaire Responses

Turn raw architecture notes into polished, professional security questionnaire responses that satisfy procurement and IT audit requirements.

Create Selective Pre-Commit Hooks for Claude Code

This prompt generates a bash script that triggers specific tests and typechecks only for packages modified in your current git branch.

Generate a Precise AGENTS.md Routing Map for Codex

Create an AGENTS.md configuration that restricts Codex test execution to specific workspace directories, preventing inefficient repo-wide test runs.