---
name: snipara-agent-security
description: "Apply security guardrails to Snipara-enabled agent workflows, including API key handling, secret storage, memory hygiene, logging, webhook/OAuth callback review, URL handling, and fail-open versus fail-closed decisions. Use for onboarding, automation, reviews, and any task that touches credentials or sensitive project data."
---

# Snipara Agent Security

## Trust Boundary

Hosted MCP endpoint: `https://api.snipara.com/mcp/YOUR_PROJECT_SLUG`. The API key belongs in environment variables or the client secret store, not in tracked files.

Before changing an agent workflow, identify:

- caller identity and auth mode
- project or team ownership boundary
- input source and whether it is user-controlled
- side effects such as writes, webhooks, deploys, memory writes, or package publication
- logs, telemetry, returned errors, and persisted artifacts

## Secrets

- Never commit API keys, OAuth tokens, private keys, database URLs, cookies, raw headers, or session secrets.
- Never store secrets in Snipara memory, handoff summaries, task commits, answer captures, or examples.
- Use `.env`, `.env.local`, OS keychains, launch agents, CI secrets, or MCP client secret fields.
- If a secret was committed or pasted into a durable artifact, treat it as compromised and rotate it.

## Memory And Logs

Persist durable reasoning, not sensitive payloads. Store decisions, workflows, and validated learnings. Do not store raw logs, transient command output, customer data dumps, credentials, or unreviewed guesses.

Sanitize logs before sharing them with agents. Keep identifiers bounded and avoid raw request bodies unless the user explicitly approves and the data is safe.

## Agent Automation

For agent hooks, collaboration guards, and deploy gates, preserve the intended fail-open or fail-closed behavior. Security-critical writes should fail closed; developer-assist hints may fail open with a visible warning.

Use Companion checks when available:

```bash
npx -y snipara-companion@latest doctor
npx -y snipara-companion@latest collaboration guard --profile pre-commit --enforce
npx -y snipara-companion@latest stuck-guard status
```

## Review Hotspots

Review OAuth/device flows, GitHub App callbacks, webhooks, internal API secrets, generated MCP configs, URL path encoding, JSON embedded into script contexts, CORS/CSP changes, rate limits, and package hooks.

State the threat reduced, files or configuration changed, tests run, and any deferred security work. Do not imply broad security coverage from a narrow patch.
