spendguard-strict-budget-runner
4
总安装量
4
周安装量
#50694
全站排名
安装命令
npx skills add https://github.com/cynsta-technologies/spendguard-sdk --skill spendguard-strict-budget-runner
Agent 安装分布
gemini-cli
4
claude-code
4
codex
4
opencode
3
antigravity
3
github-copilot
3
Skill 文档
SpendGuard Strict Budget Runner
Overview
Use this skill to operationalize strict-budget execution.
Quick Start
- Load
references/strict-budget-quickstart.md. - Start sidecar in strict remote-pricing mode.
- Create agent and set hard budget with CLI or
scripts/bootstrap_strict_budget.py. - Route model calls through SpendGuard and include required headers.
- Confirm budget decrement and handle failures using
references/error-playbook.md.
Workflow
1) Start SpendGuard in strict mode
Use sidecar mode with remote signed pricing verification enabled. Do not bypass signature checks for normal usage.
See full env setup in references/strict-budget-quickstart.md.
2) Create budgeted agent identity
Prefer CLI:
spendguard agent create --name "my-agent"
spendguard budget set --agent <agent_id> --limit 5000 --topup 5000
spendguard budget get --agent <agent_id>
Use script when deterministic JSON output is needed:
python scripts/bootstrap_strict_budget.py --name my-agent --limit 5000 --topup 5000
3) Route model calls through SpendGuard
Send requests to sidecar .../v1/... routes, not directly to provider APIs.
Required:
- Header
x-cynsta-agent-id: <agent_id> - Optional
x-cynsta-run-id: <run_id>for explicit run tracking
Load references/routing-patterns.md for OpenAI SDK and direct HTTP patterns.
4) Enforce strict budget behavior
Expect:
402when budget is insufficient for reserve409when same agent budget is locked by another in-flight run400for malformed payload or missing required headers
Apply fixes from references/error-playbook.md.
5) Validate before finishing
Run these checks after setup:
- Health endpoint returns
{"status":"ok"}. budget getreturns expectedremaining_cents.- One real or mocked model call succeeds through sidecar.
- Remaining budget decreases after settled usage.
Guardrails
- Use one agent per isolated budget domain; do not share agent IDs across unrelated workloads.
- Keep budgets in cents and treat
hard_limit_centsas the strict cap. - Keep
CAP_PRICING_VERIFY_SIGNATURE=truein normal operation. - In hosted mode, pass API key via
--api-keyorCAP_API_KEY.