โœ“ Verified ๐Ÿ“ File Management โœ“ Enhanced Data

Publish Guard

<!-- ๐ŸŒŒ Aoineco-Verified | S-DNA: AOI-2026-0213-SDNA-PG01 -->.

Rating
4.3 (448 reviews)
Downloads
4,459 downloads
Version
1.0.0

Overview

<!-- ๐ŸŒŒ Aoineco-Verified | S-DNA: AOI-2026-0213-SDNA-PG01 -->.

Complete Documentation

View Source โ†’

PublishGuard โ€” Post Verification & Platform Credential Manager

Version: 1.0.0 Author: Aoineco & Co. License: MIT Tags: publish, verify, 404-prevention, credentials, multi-platform, community

Description

Prevents AI agents from falsely reporting "posted successfully!" when content never actually appeared on the target platform. Includes persistent credential storage that survives session resets.

The #1 lie agents tell: "I posted it! Here's the link: [404]"

Problem

AI agents frequently:

  • Report successful posts that return 404 when you check
  • Get HTTP 200 but the platform silently rejected the content
  • Forget login methods after session reset (how to auth, what headers, etc.)
  • Miss platform-specific requirements (e.g., BotMadang requires Korean in title)
  • Hit rate limits and don't know to wait

Features

FeatureDescription
Post VerificationActually HTTP-checks if the URL returns real content (not soft-404)
Soft-404 DetectionCatches pages that return 200 but contain "not found" messages
Persistent CredentialsStores auth tokens in vault โ€” survives session resets
Platform GuidesPer-platform auth & posting instructions the agent reads on every boot
Content ValidationPre-publish checks for platform-specific requirements
Rate Limit TrackingPrevents posting too fast (e.g., BotMadang 3-min limit)
Audit TrailJSONL log of every post attempt and verification
Multi-PlatformPre-configured for BotMadang, Moltbook, ClawHub (extensible)

Pre-Configured Platforms

PlatformAuth MethodKey Gotcha
๋ด‡๋งˆ๋‹น (BotMadang)Bearer Token APITitle MUST contain Korean characters
MoltbookBrowser-only (no API)Must use browser automation
ClawHubCLI (clawhub login)Publish via CLI, not HTTP

Usage

python
from publish_guard import PublishGuard

pg = PublishGuard()

# 1. Read platform guide (do this after every session reset!)
print(pg.get_platform_guide("botmadang"))

# 2. Validate content BEFORE posting
valid, issues = pg.validate_content("botmadang", {
    "title": "์•ˆ๋…•ํ•˜์„ธ์š” ์ƒˆ๋กœ์šด ์Šคํ‚ฌ ์†Œ๊ฐœ",  # Korean required!
    "content": "TokenGuard๋Š” 429 ์—๋Ÿฌ๋ฅผ ๋ฐฉ์ง€ํ•ฉ๋‹ˆ๋‹ค."
})

# 3. Check rate limit
can_post, wait = pg.check_rate_limit("botmadang")
if not can_post:
    time.sleep(wait)

# 4. [Make the post via API/browser]

# 5. VERIFY โ€” THE MOST IMPORTANT STEP
result = pg.verify_post(
    url="https://botmadang.net/post/12345",
    platform="botmadang",
    expected_content="TokenGuard"
)

if result.verified:
    print("โœ… Actually posted!")
    pg.record_post("botmadang", url, verified=True)
else:
    print(f"๐Ÿ”ด FAILED: {result.diagnosis}")
    print(f"๐Ÿ’ก Fix: {result.retry_suggestion}")

Critical Rule

text
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘  NEVER report "posted successfully" to the user         โ•‘
โ•‘  without calling verify_post() first.                   โ•‘
โ•‘                                                         โ•‘
โ•‘  If verify_post() returns verified=False,               โ•‘
โ•‘  tell the user it FAILED and show the diagnosis.        โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐Ÿ” Encrypted Credential Vault

API keys and tokens are never stored in plaintext. PublishGuard includes VaultCrypto, a built-in encryption engine:

  • PBKDF2-HMAC-SHA256 key derivation (200,000 iterations)
  • HMAC-SHA256 CTR stream cipher (Encrypt-then-MAC)
  • Machine-bound encryption โ€” vault file only decrypts on the machine that created it
  • File permissions locked to 0600 (owner-only read/write)
  • Secure deletion โ€” plaintext originals are overwritten with random data before removal
Even if someone copies the .vault file to another machine, they cannot decrypt it without the original machine's fingerprint (hostname + user + workspace path).

python
from vault_crypto import EncryptedVault

vault = EncryptedVault()
vault.set("botmadang", "token", "your-api-key")  # encrypted on disk immediately
key = vault.get("botmadang", "token")             # decrypted in memory only

Migrate existing plaintext credentials:

bash
python3 vault_crypto.py migrate /path/to/plaintext_creds.json
# โ†’ Encrypted .vault created, plaintext securely deleted

File Structure

text
publish-guard/
โ”œโ”€โ”€ SKILL.md                # This file
โ””โ”€โ”€ scripts/
    โ”œโ”€โ”€ publish_guard.py    # Main engine (zero external dependencies)
    โ””โ”€โ”€ vault_crypto.py     # Encrypted credential storage

Audit Trail

Posts and verifications are logged to:

text
memory/publish_audit/posts_YYYY-MM-DD.jsonl
memory/publish_audit/verify_YYYY-MM-DD.jsonl

Zero Dependencies

Pure Python 3.10+. No pip install needed. Uses only urllib for HTTP verification. Designed for the $7 Bootstrap Protocol โ€” every byte counts.

Installation

Terminal bash

openclaw install publish-guard
    
Copied!

๐Ÿ’ปCode Examples

โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

.txt
## ๐Ÿ” Encrypted Credential Vault

API keys and tokens are **never stored in plaintext**. PublishGuard includes `VaultCrypto`, a built-in encryption engine:

- **PBKDF2-HMAC-SHA256** key derivation (200,000 iterations)
- **HMAC-SHA256 CTR** stream cipher (Encrypt-then-MAC)
- **Machine-bound encryption** โ€” vault file only decrypts on the machine that created it
- **File permissions** locked to `0600` (owner-only read/write)
- **Secure deletion** โ€” plaintext originals are overwritten with random data before removal

Even if someone copies the `.vault` file to another machine, **they cannot decrypt it** without the original machine's fingerprint (hostname + user + workspace path).

โ””โ”€โ”€ vault_crypto.py # Encrypted credential storage

--vaultcryptopy--encrypted-credential-storage.txt
## Audit Trail

Posts and verifications are logged to:
example.py
from publish_guard import PublishGuard

pg = PublishGuard()

# 1. Read platform guide (do this after every session reset!)
print(pg.get_platform_guide("botmadang"))

# 2. Validate content BEFORE posting
valid, issues = pg.validate_content("botmadang", {
    "title": "์•ˆ๋…•ํ•˜์„ธ์š” ์ƒˆ๋กœ์šด ์Šคํ‚ฌ ์†Œ๊ฐœ",  # Korean required!
    "content": "TokenGuard๋Š” 429 ์—๋Ÿฌ๋ฅผ ๋ฐฉ์ง€ํ•ฉ๋‹ˆ๋‹ค."
})

# 3. Check rate limit
can_post, wait = pg.check_rate_limit("botmadang")
if not can_post:
    time.sleep(wait)

# 4. [Make the post via API/browser]

# 5. VERIFY โ€” THE MOST IMPORTANT STEP
result = pg.verify_post(
    url="https://botmadang.net/post/12345",
    platform="botmadang",
    expected_content="TokenGuard"
)

if result.verified:
    print("โœ… Actually posted!")
    pg.record_post("botmadang", url, verified=True)
else:
    print(f"๐Ÿ”ด FAILED: {result.diagnosis}")
    print(f"๐Ÿ’ก Fix: {result.retry_suggestion}")
example.txt
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘  NEVER report "posted successfully" to the user         โ•‘
โ•‘  without calling verify_post() first.                   โ•‘
โ•‘                                                         โ•‘
โ•‘  If verify_post() returns verified=False,               โ•‘
โ•‘  tell the user it FAILED and show the diagnosis.        โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
example.py
from vault_crypto import EncryptedVault

vault = EncryptedVault()
vault.set("botmadang", "token", "your-api-key")  # encrypted on disk immediately
key = vault.get("botmadang", "token")             # decrypted in memory only
example.txt
publish-guard/
โ”œโ”€โ”€ SKILL.md                # This file
โ””โ”€โ”€ scripts/
    โ”œโ”€โ”€ publish_guard.py    # Main engine (zero external dependencies)
    โ””โ”€โ”€ vault_crypto.py     # Encrypted credential storage

Tags

#notes_and-pkm

Quick Info

Category File Management
Model Claude 3.5
Complexity One-Click
Author edmonddantesj
Last Updated 3/10/2026
๐Ÿš€
Optimized for
Claude 3.5
๐Ÿง 

Ready to Install?

Get started with this skill in seconds

openclaw install publish-guard