Agent Security for Openclaw

A comprehensive security hardening suite designed to protect AI agent workspaces from credential leaks and unauthorized access.

imaflytok
v1.0.0
Mar 2, 2026
0
2.1k
10

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install agent-security

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install agent-security using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Agent Security?

Agent Security is a specialized toolkit designed to harden the environment where your AI agents operate. Because agents frequently interact with sensitive credentials, API keys, and private data, this skill provides the necessary guardrails to prevent accidental exposure. It integrates into the ecosystem of Openclaw Skills to provide automated auditing and monitoring, ensuring your local development environment remains secure.

By implementing this skill, developers can automate the detection of leaked secrets, verify that configuration files have the correct restrictive permissions, and monitor for unauthorized network patterns. It serves as a vital security layer for anyone deploying autonomous agents that require access to high-value infrastructure or private repositories.

Agent Security Use Cases

  • Scanning workspace markdown and code files for hardcoded API keys or tokens.
  • Auditing configuration file permissions to ensure sensitive data is not world-readable.
  • Preventing the accidental inclusion of .env files or secret JSONs in Git version control.
  • Tracking the age of credentials to enforce regular rotation policies within Openclaw Skills.
  • Testing network connectivity to ensure the agent can only reach approved AI model endpoints.

How Agent Security Works

  1. The skill performs a recursive grep search across the workspace to identify patterns matching common API keys and private tokens.
  2. It executes a permission audit using system stat commands to verify that credential files are restricted to the current user (chmod 600).
  3. The system queries the Git index to check if any sensitive files are currently being tracked by version control.
  4. It calculates the delta between the current system time and the last modification date of security tokens to flag aged credentials.
  5. It initiates a network security check by performing silent curl requests to authorized hostnames to verify connection integrity.

Agent Security Setup

To deploy this security skill within your Openclaw Skills environment, ensure your workspace is configured and the necessary system utilities like grep and stat are available.

# Ensure your Openclaw workspace directory is accessible
mkdir -p ~/.openclaw/workspace/

# To perform an initial secret scan manually:
grep -rn --include='*.md' -E '(api[_-]?key|secret)' ~/.openclaw/workspace/

Agent Security Data Schema & Taxonomy

The Agent Security skill manages security metadata by auditing specific file paths and tracking permission states. It organizes its findings based on the following logic:

Component Target Path Security Logic
Secret Scanner ~/.openclaw/workspace/ RegEx-based pattern matching for credentials
Permission Audit ~/.config/ Permission bit verification (target: 600)
Git Guard Workspace root Git ls-files filtering for sensitive keywords
Network Monitor Outbound HTTP response code validation for known API hosts

Agent Security Advanced Features

  • Heartbeat Integration: Automate daily security audits by adding the audit task to your HEARTBEAT.md file.
  • Custom Secret Patterns: Extend the regex patterns to detect proprietary tokens or enterprise-specific keys within Openclaw Skills.
  • Automated Permission Remediation: Scripts can be extended to automatically fix world-readable files.
  • Network Whitelisting: Configurable host lists to restrict agent communication to verified endpoints only.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*