xguard-manager

Read, replace, reset, export, and import XGuard policy options on the orchestrator.

7.2k|734|Updated Oct 11, 2022
One-click install
npx skills add https://github.com/civitai/civitai --skill xguard-manager
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xguard-manager
Source: https://github.com/civitai/civitai/tree/main/.claude/skills/xguard-manager
Command: npx skills add https://github.com/civitai/civitai --skill xguard-manager

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing XGuard content-scanning policies requires calling the orchestrator's admin endpoints by hand, which is error-prone and risky when destructive changes affect every subsequent scan. This Skill provides a safe CLI wrapper for inspecting, editing, backing up, and restoring per-label policy options.

Core Features & Use Cases

  • Policy Inspection: Fetch current or default policy options for text or prompt scan modes via GET requests.
  • Guarded Writes: PUT, reset, and import operations require an explicit --writable flag, preventing accidental global policy changes.
  • Backup and Restore: Export the full policy registry to JSON before edits and import it back to roll back.
  • Use Case: During scanner prompt tuning, export a backup, pull the current prompt-mode policies, edit the policy text, ship the new version, then track FP/FN rates against the new policyHash in the audit log.

Quick Start

Ask the AI to show the current XGuard prompt-mode policy options using the xguard-manager skill.

Frequently Asked Questions about xguard-manager

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I update XGuard policy options on the orchestrator?

Export a backup first, then fetch current options with the get command, edit the JSON file, and run put with --file and --writable. The --writable flag is mandatory because policy changes affect every subsequent scan.

How do I back up and restore XGuard policies?

Run the export command with -o to save the full policy registry across all modes to a JSON file. To restore, run import with -f pointing at that backup file plus the --writable flag.

What environment variables does the XGuard manager need?

It reads ORCHESTRATOR_ENDPOINT and ORCHESTRATOR_ACCESS_TOKEN from the project .env file, or from a skill-specific .env for overrides. Both must be set or the script exits with an error.

Why does the put or reset command refuse to run?

Destructive commands (put, reset, import) require the explicit --writable flag as a safety guard. Without it, the script prints a usage error and exits, since these operations change orchestrator state globally.

What scan modes does XGuard policy management support?

The get, defaults, put, and reset commands accept a mode argument that must be either text or prompt. Any other value is rejected with a validation error before any request is made.