Xpersona
S

self-improving-security

CLAWHUB · Unverified

Captures vulnerabilities, misconfigurations, access control violations, compliance gaps, incident response patterns, and threat intelligence to enable continuous security improvement. Use when: (1) A CVE or vulnerability is discovered, (2) Secrets are exposed in logs or output, (3) Access control violations or unauthorized access attempts occur, (4) Compliance audit findings or gaps are identified, (5) Security misconfigurations are found in infrastructure or applications, (6) Incident response procedures are executed or improved, (7) Threat intelligence is gathered from advisories or pen test results. Skill: self-improving-security Owner: jose-compu Summary: Captures vulnerabilities, misconfigurations, access control violations, compliance gaps, incident response patterns, and threat intelligence to enable continuous security improvement. Use when: (1) A CVE or vulnerability is discovered, (2) Secrets are exposed in logs or output, (3) Access control violations or unauthorized access attempts occur, (4) Compliance

62
Rank
84
Safety
1.1k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: medium.

clawhub skill install s17bzpdy0evfmqz6nx069npr3n84p7f2:self-improving-security
  1. Setup complexity is MEDIUM. Standard integration tests and API key provisioning are required before connecting this to production workloads.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-jose-compu-self-improving-security/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

146,111 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: self-improving-security
description: "Captures vulnerabilities, misconfigurations, access control violations, compliance gaps, incident response patterns, and threat intelligence to enable continuous security improvement. Use when: (1) A CVE or vulnerability is discovered, (2) Secrets are exposed in logs or output, (3) Access control violations or unauthorized access attempts occur, (4) Compliance audit findings or gaps are identified, (5) Security misconfigurations are found in infrastructure or applications, (6) Incident response procedures are executed or improved, (7) Threat intelligence is gathered from advisories or pen test results."
---

# Self-Improving Security Skill

Log security learnings, incidents, and compliance findings to markdown files for continuous improvement. Security-specific entries track vulnerabilities, misconfigurations, access violations, and incident response outcomes. Mature patterns get promoted to security runbooks, hardening checklists, incident response playbooks, and compliance matrices.

## CRITICAL: Sensitive Data Redaction

**NEVER log actual secrets, credentials, tokens, private keys, API keys, passwords, connection strings, or PII in any learning or incident entry.** Always redact sensitive values before writing. Use placeholders:

| Sensitive Data | Redacted Form |
|----------------|---------------|
| API keys | `REDACTED_API_KEY` |
| Passwords | `REDACTED_PASSWORD` |
| Access tokens (JWT, bearer, session) | `REDACTED_TOKEN` |
| Private keys | `REDACTED_PRIVATE_KEY` |
| Connection strings | `REDACTED_CONNECTION_STRING` |
| PII (emails, SSNs) | `REDACTED_PII` |
| IP addresses (internal) | `REDACTED_INTERNAL_IP` |
| Certificate contents | `REDACTED_CERT` |

When logging an incident involving exposed secrets, describe *what kind* of secret was exposed, *where* it appeared, and *the remediation taken* — never the secret itself.

## First-Use Initialisation

Before logging anything, ensure the `.learnings/` directory and files exist in the project or workspace root. If any are missing, create them:

```bash
mkdir -p .learnings
[ -f .learnings/LEARNINGS.md ] || printf "# Security Learnings\n\nVulnerabilities, misconfigurations, compliance gaps, and security insights.\n\n**Categories**: vulnerability | misconfiguration | access_violation | compliance_gap | incident_response | threat_intelligence\n**Areas**: authentication | authorization | encryption | network | endpoint | compliance | cloud\n\n---\n" > .learnings/LEARNINGS.md
[ -f .learnings/SECURITY_INCIDENTS.md ] || printf "# Security Incidents Log\n\nVulnerability discoveries, access violations, secrets exposure, and active security incidents.\n\n---\n" > .learnings/SECURITY_INCIDENTS.md
[ -f .learnings/FEATURE_REQUESTS.md ] || printf "# Security Feature Requests\n\nSecurity capabilities and hardening improvements requested or identified.\n\n---\n" > .learnings/FEATURE_REQUESTS.md
```

Never overwrite existing files. This is a no-op if `.learnings/`

_meta.json

{
  "ownerId": "kn78jat5kd20evgyxzp9dmryax84qap0",
  "slug": "self-improving-security",
  "version": "1.2.2",
  "publishedAt": 1790688437152
}

references/examples.md

# Security Entry Examples

Concrete examples of well-formatted security entries with all fields.

## Learning: Vulnerability (SQL Injection)

```markdown
## [LRN-20250415-001] vulnerability

**Logged**: 2025-04-15T09:30:00Z
**Priority**: critical
**Status**: pending
**Area**: endpoint
**CVSS**: 9.8

### Summary
SQL injection vulnerability in legacy `/api/v1/users/search` endpoint via unparameterized query

### Details
The legacy search endpoint constructs SQL queries by concatenating user-supplied
`q` parameter directly into the WHERE clause without parameterization. The endpoint
was excluded from the newer ORM-based query builder during the v2 migration.

Affected code: `src/api/v1/controllers/userSearch.js:47`
Pattern: `"SELECT * FROM users WHERE name LIKE '%" + req.query.q + "%'"`

### Remediation
1. Replace string concatenation with parameterized query using the ORM
2. Add input validation middleware for the `q` parameter
3. Add SQL injection tests to the security test suite
4. Consider deprecating the v1 endpoint entirely

### Metadata
- Source: pen_test
- Related Files: src/api/v1/controllers/userSearch.js
- Tags: sql-injection, legacy-code, input-validation
- CWE: CWE-89
- CVE: N/A (internal finding)
- See Also: LRN-20250320-003

---
```

## Learning: Misconfiguration (S3 Bucket Public Access)

```markdown
## [LRN-20250415-002] misconfiguration

**Logged**: 2025-04-15T11:00:00Z
**Priority**: high
**Status**: resolved
**Area**: cloud
**CVSS**: 7.5

### Summary
S3 bucket `company-internal-docs` configured with public read access, exposing internal documentation

### Details
During cloud posture review, discovered that the `company-internal-docs` S3 bucket
had `PublicReadAccess` enabled via a legacy bucket policy. The bucket contained
internal architecture diagrams, API documentation, and onboarding guides. No
credentials or PII were stored in the bucket.

The misconfiguration was introduced during the 2024 migration from the old
storage account when the bucket policy was copied without review.

### Remediation
1. Immediately set bucket to private: `aws s3api put-public-access-block`
2. Audit all S3 buckets for public access: `aws s3api get-public-access-block`
3. Enable S3 Block Public Access at the account level
4. Add Terraform policy to enforce private-by-default on all new buckets

### Metadata
- Source: audit
- Related Files: terraform/modules/s3/main.tf
- Tags: s3, public-access, cloud-posture, aws
- CWE: CWE-732
- Pattern-Key: harden.s3_public_access
- Recurrence-Count: 1
- First-Seen: 2025-04-15
- Last-Seen: 2025-04-15

### Resolution
- **Resolved**: 2025-04-15T13:00:00Z
- **Commit/PR**: #287
- **Remediation Applied**: Bucket set to private, account-level public access block enabled
- **Verified By**: manual review + AWS Config rule

---
```

## Learning: Compliance Gap (GDPR Consent)

```markdown
## [LRN-20250415-003] compliance_gap

**Logged**: 2025-04-15T14:00:00Z
**Priority**: high
**Status**: in_progress
**Area**: compliance
**C

references/hooks-setup.md

# Security Hook Setup Guide

Configure automatic security self-improvement triggers for AI coding agents.

## Overview

Hooks can help capture security findings with minimal overhead:
- **UserPromptSubmit** (recommended): Reminder after matching prompts to evaluate security findings
- **PostToolUse (Bash)** (optional): Detection when high-signal security patterns appear in command output (trusted environments only)

## Claude Code Setup

### Option 1: Project-Level Configuration

Create `.claude/settings.json` in your project root (activator-only recommended):

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "security|vuln|CVE|auth|permission|secret|credential|compliance",
        "hooks": [
          {
            "type": "command",
            "command": "./skills/self-improving-security/scripts/activator.sh"
          }
        ]
      }
    ]
  }
}
```

### Command output detection

Leave PostToolUse disabled. Do not attach `error-detector.sh` to every Bash call.

### Option 2: User-Level Configuration (discouraged)

Do **not** install this hook globally. User-level hooks persist across all repositories and sessions. Keep hooks project-scoped. The example below is shown only so you can recognize and remove it:

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "security|vuln|CVE|auth|permission|secret|credential|compliance",
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/skills/self-improving-security/scripts/activator.sh"
          }
        ]
      }
    ]
  }
}
```

### Minimal Setup (Activator Only)

For lower overhead, use only the UserPromptSubmit hook:

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "security|vuln|CVE|auth|permission|secret|credential|compliance",
        "hooks": [
          {
            "type": "command",
            "command": "./skills/self-improving-security/scripts/activator.sh"
          }
        ]
      }
    ]
  }
}
```

## Codex CLI Setup

Codex uses the same hook system. Create `.codex/settings.json`:

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "security|vuln|CVE|auth|permission|secret|credential|compliance",
        "hooks": [
          {
            "type": "command",
            "command": "./skills/self-improving-security/scripts/activator.sh"
          }
        ]
      }
    ]
  }
}
```

## GitHub Copilot Setup

Copilot doesn't support hooks directly. Add guidance to `.github/copilot-instructions.md`:

```markdown
## Security Self-Improvement

After completing tasks that involved:
- Reviewing or modifying authentication/authorization code
- Working with secrets, credentials, or environment variables
- Configuring cloud resources or network policies
- Addressing vulnerability scan findings
- Handling compliance requirements

Consider logging the finding to `.learnings/` using the security self-improvement skill format.

CRITICAL: NEVER inc

references/openclaw-integration.md

# OpenClaw Security Integration

Complete setup and usage guide for integrating the security self-improvement skill with OpenClaw.

## Overview

OpenClaw uses workspace-based prompt injection combined with event-driven hooks. Security context is injected from workspace files at session start, and hooks trigger on lifecycle events to remind the agent about security finding capture.

## Workspace Structure

```
~/.openclaw/
├── workspace/                   # Working directory
│   ├── AGENTS.md               # Incident response workflows, security automation
│   ├── SOUL.md                 # Security principles, assume-breach mindset
│   ├── TOOLS.md                # Security tool configs, scanner gotchas
│   ├── HARDENING.md            # Infrastructure and application hardening checklist
│   ├── PLAYBOOKS.md            # Incident response playbooks
│   ├── COMPLIANCE.md           # Compliance matrices and audit evidence
│   ├── MEMORY.md               # Long-term memory (main session only)
│   └── .learnings/             # Security finding logs
│       ├── LEARNINGS.md
│       ├── SECURITY_INCIDENTS.md
│       └── FEATURE_REQUESTS.md
├── skills/                      # Installed skills
│   └── self-improving-security/
│       └── SKILL.md
└── hooks/                       # Custom hooks
    └── self-improving-security/
        ├── HOOK.md
        └── handler.ts
```

## Quick Setup

### 1. Install the Skill

```bash
clawdhub install self-improving-security
```

Or copy manually:

```bash
cp -r self-improving-security ~/.openclaw/skills/
```

### 2. Install the Hook (Optional)

Copy the hook to OpenClaw's hooks directory:

```bash
mkdir -p .openclaw/hooks
cp -r hooks/openclaw .openclaw/hooks/self-improving-security
```


### 3. Create Learning Files

```bash
mkdir -p ~/.openclaw/workspace/.learnings
```

Or copy from `assets/`:

```bash
cp assets/LEARNINGS.md ~/.openclaw/workspace/.learnings/
cp assets/ERRORS.md ~/.openclaw/workspace/.learnings/SECURITY_INCIDENTS.md
cp assets/FEATURE_REQUESTS.md ~/.openclaw/workspace/.learnings/
```

## Injected Prompt Files

### AGENTS.md (Security Workflows)

Purpose: Incident response workflows and security automation patterns.

```markdown
# Security Agent Coordination

## Incident Response Workflow
1. Detect: Identify the security finding or incident
2. Triage: Assess severity, blast radius, and urgency
3. Contain: Apply immediate containment measures
4. Remediate: Fix the root cause
5. Verify: Confirm remediation is effective
6. Document: Log to .learnings/ with full context

## Delegation Rules
- Do not spawn sub-agents or read other sessions from this skill
- Log a redacted note in this workspace only
- Do not send cross-session messages
```

### SOUL.md (Security Principles)

Purpose: Security mindset and principles.

```markdown
# Security Principles

## Core Mindset
- Assume breach: act as if attackers already have access
- Defense in depth: never rely on a single control
- Least privilege: grant minimum per

Sponsored

Ads related to self-improving-security and adjacent AI workflows.