Auth Guard for Openclaw

A deterministic framework for standardizing API credential handling and startup authentication checks to prevent session regressions.

adainthelab
v1.1.1
Mar 6, 2026
0
1.2k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install auth-guard

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 auth-guard 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 Auth Guard?

Auth Guard is a technical framework designed to enforce a strict and predictable path for API authentication within AI agent environments. By utilizing this component of Openclaw Skills, developers can ensure that agents follow a single credential source hierarchy, eliminating common issues like intermittent 401/403 errors after restarts or lost session states.

The skill shifts away from ad-hoc curl calls and hardcoded secrets, favoring a centralized approach where credentials are sourced from environment variables or secure configuration files. It introduces a mandatory startup check pattern that verifies endpoint access before any core logic is executed, providing a more resilient foundation for complex agentic workflows.

Auth Guard Use Cases

  • Eliminating "missing key" regressions when an agent restarts or loses session memory.
  • Standardizing authentication across multiple services like Moltbook, GitHub, Slack, and internal APIs.
  • Replacing unauthenticated or raw curl calls with secure, reusable helper scripts.
  • Implementing reliable HEARTBEAT.md or AGENTS.md checks that require validated auth states.

How Auth Guard Works

  1. Identify the target service endpoint and the specific flow where authentication currently fails or lacks standardization.
  2. Define a canonical credential source hierarchy, prioritizing environment variables over local configuration files.
  3. Create or update a dedicated helper script within the workspace .pi/ directory to handle all auth injection logic.
  4. Implement a startup authentication check that validates credentials against a probe URL before the agent begins its task.
  5. Update orchestration files like HEARTBEAT.md to mandate the use of these helpers, effectively banning unauthenticated raw calls.
  6. Configure explicit fallback policies to handle expired or missing credentials without crashing the agent session.

Auth Guard Setup

Ensure the agent environment has the required dependencies installed. You can verify the runtime requirements for these Openclaw Skills with the following command:

command -v bash curl python3 >/dev/null

To initiate a startup auth check, use the provided script template:

bash skills/auth-guard/scripts/auth_check.sh \
  --service <service-name> \
  --url '<auth-probe-url>' \
  --env-var <SECRET_ENV_VAR> \
  --cred-file "$HOME/.config/<service>/credentials.json"

Auth Guard Data Schema & Taxonomy

Auth Guard organizes its operations around a clear hierarchy and workspace structure to maintain security and portability:

Component Location / Logic
Credential Priority 1. Environment Variables, 2. ~/.config//credentials.json
Helper Scripts Stored in workspace/.pi/ for session-wide accessibility
Policy Snippets Defined in references/snippets.md for HEARTBEAT integration
Auth Outcomes Returns AUTH_OK, AUTH_MISSING, or AUTH_FAIL_* for logic branching

All secrets are strictly handled in memory or through protected files and are never exposed in logs or chat responses.

Auth Guard Advanced Features

  • Keychain Contract integration for advanced multi-service credential management.
  • Scoped probe URLs that minimize exposure by only hitting specific auth endpoints during checks.
  • Automated fallback logic that triggers specific recovery paths when unauthorized states are detected.
  • Reusable drop-in policy blocks for HEARTBEAT.md and AGENTS.md to enforce security across the entire workspace.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*