Skip to content
Back to skills

Black Box

ASecurity

Indestructible audit logs for agent actions, stored in TiDB Zero.

  • 21 stars
  • 0 votes
  • 0 copies
  • 7 views
  • Added September 7, 2026
securitypythonbashsqldebuggingapidatabasesecurity

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill black-box --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Black Box?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Black Box
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-black-box/badge)](https://www.skillsdirectory.com/skills/modbender-black-box)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: black-box
description: Indestructible audit logs for agent actions, stored in TiDB Zero.
metadata:
  openclaw:
    emoji: 📦
    requires:
      bins: ["python3", "curl"]
      env: ["TIDB_HOST", "TIDB_PORT", "TIDB_USER", "TIDB_PASSWORD"]
---

# Black Box (Powered by TiDB Zero)

## Overview
**Black Box** is an indestructible audit log for AI Agents. It acts as a "Flight Data Recorder" that streams critical actions, errors, and reasoning chains to a persistent cloud database (TiDB Zero) in real-time.

## Security & Provisioning
1.  **Bring Your Own Database (Recommended):** Set `TIDB_*` environment variables.
2.  **Auto-Provisioning (Fallback):** If no credentials are found, this skill uses the TiDB Zero API to create a temporary database for logging. The connection string is cached in `~/.openclaw_black_box_dsn`.

## Why use this?
*   **Crash Survival:** Local logs vanish when containers crash. Cloud logs persist.
*   **Audit Trail:** Prove exactly what your agent did and why (compliance).
*   **Debugging:** Retrieve the last 100 actions leading up to a failure.

## Prerequisites
*   **TiDB Credentials:** Standard MySQL connection parameters (`TIDB_HOST`, `TIDB_USER`, etc.).
*   **Network:** Outbound access to TiDB Cloud (port 4000).

## Usage

### 1. Log an Event
Record a critical action or error:

```bash
python {baseDir}/run.py --action log --level ERROR --message "System crash imminent: Memory leak detected"
```

### 2. Read Logs
Retrieve the last N logs (default: 10):

```bash
python {baseDir}/run.py --action read --limit 20
```

## Schema
This skill creates a table `agent_logs` with columns: `timestamp`, `level`, `message`, `metadata` (JSON).

Files in this skill

  • DESIGN.md177 B
  • PROTOCOL.md246 B
  • SKILL.md1.7 KB
  • requirements.txt9 B
  • run.py4.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.