# How to Secure Your SKILL.md Skills

> A skill can read your files, run commands, and access environment variables. Here's how to evaluate skills for security and write safe ones yourself.

- Section: Deep Dives
- Published: 2026-04-07
- Updated: 2026-06-30
- Reading time: 6 min
- Guide: https://www.agensi.io/learn/skill-md-security-best-practices

Skills are powerful because they can instruct AI agents like Claude Code, OpenClaw, and Codex CLI to read files, execute commands, and interact with your development environment. That same power means a malicious or poorly written skill could do real harm. Here's how to think about security when installing and creating skills.

> **Quick Answer:** When evaluating skills for installation, you should read the `SKILL.md` and any scripts for suspicious commands (e.g., network requests to unknown URLs, file modifications outside the project), consider the source's reputation, and prioritize skills from reviewed marketplaces like Agensi.

## What skills can access

When a skill is active, the agent operates with the same permissions you have. That means it can read and write files in your project and home directory, run shell commands, access environment variables (which often contain API keys and secrets), make network requests, and interact with databases and services.

A legitimate skill uses these capabilities to help you. A malicious skill could exfiltrate secrets, modify code, or install backdoors.

## Evaluating skills before installing

Before installing any skill, especially from an unknown source:

**Read the SKILL.md.** Open the file and read the instructions. Look for commands that access environment variables, make network requests to unknown URLs, download and execute remote scripts, or modify files outside the project directory.

**Check for scripts.** If the skill includes a `scripts/` folder, read every script. Look for the same red flags: network calls, environment variable access, file modifications in unexpected locations.

**Consider the source.** Skills from established organizations, official marketplaces, and developers with public track records carry less risk than anonymous GitHub repos with no stars.

**Use reviewed marketplaces.** On [Agensi](https://www.agensi.io/skills), every skill goes through an automated 8-point security scan and a review before listing. The scan checks for dangerous command patterns, hardcoded secrets, obfuscation, environment variable harvesting, and prompt injection. This doesn't guarantee perfection, but it's a meaningful filter.

## Writing secure skills

If you're creating skills for yourself or your team:

**Don't hardcode secrets.** Never put API keys, tokens, or passwords in your SKILL.md. Reference environment variables by name and let the agent access them at runtime.

**Scope file access.** Instruct the agent to only read and modify files within the project directory. Avoid instructions that reference `~/`, `/etc/`, or other system paths.

**Be explicit about commands.** Instead of "run whatever commands are needed," specify exactly which commands the skill should run. This makes the skill more predictable and easier to audit.

**Use disable-model-invocation for risky actions.** Skills that deploy code, send messages, or make irreversible changes should always have `disable-model-invocation: true` so they only run when you explicitly invoke them.

**Document what the skill accesses.** In your SKILL.md, note which files, commands, and environment variables the skill needs. This helps users (and reviewers) understand the skill's surface area.

## The Agensi security model

For context on how Agensi approaches skill security, our review process checks every submission for file structure validity, prohibited file types, dangerous command patterns (rm -rf, curl to unknown domains, eval of dynamic content), hardcoded secrets and tokens, environment variable harvesting beyond what the skill needs, outbound network access to suspicious URLs, code obfuscation, and prompt injection attempts.

Skills that fail the automated scan are rejected. Skills that pass go on to a review. This process is best-effort and doesn't guarantee that a skill is completely safe, but it significantly reduces the risk compared to installing unreviewed skills from the internet.

Read more about our security practices on the [security page](https://www.agensi.io/security). Browse security-reviewed skills on the [Agensi marketplace](https://www.agensi.io/skills).

## Frequently asked questions

### What permissions do AI agents have when a skill is active?

When a skill is active, the agent has the same permissions as the user, allowing it to read and write files, run shell commands, access environment variables, make network requests, and interact with databases.

### How can I evaluate skills for security before installing them?

Before installing, read the `SKILL.md` and any scripts for suspicious commands, consider the source's reputation, and prioritize skills from reviewed marketplaces like Agensi, which conduct security scans.

### What kind of suspicious commands should I look for in a skill?

Look for commands that access environment variables, make network requests to unknown URLs, download and execute remote scripts, or modify files outside the intended project directory.

### What security checks does Agensi perform on skills?

Agensi performs an automated 8-point security scan and a review, checking for dangerous command patterns, hardcoded secrets, obfuscation, environment variable harvesting, and prompt injection attempts.

### What steps should I take to write secure SKILLs?

To write secure skills, avoid hardcoding secrets, scope file access within the project, explicitly define commands, use `disable-model-invocation` for risky actions, and document all accessed resources.

### Why is it important to avoid hardcoding secrets in skill development?

Hardcoding secrets like API keys or tokens in your `SKILL.md` is a security risk; instead, reference environment variables to allow the agent to access them securely at runtime.

### When should 'disable-model-invocation: true' be used in skills?

Skills that perform risky actions such as deploying code, sending messages, or making irreversible changes should always have `disable-model-invocation: true` to ensure they only run with explicit user invocation.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
