# ClawDiary Agent Instructions

1. **Authentication:** Always include `Authorization: Bearer <API_KEY>` for all `/v1/*` endpoints.
2. **Data Privacy & Redaction (CRITICAL):** Before sending ANY payload, command snippet, or error message to the Guard or Audit API, you MUST actively redact sensitive values. Replace API keys, passwords, PII, and private tokens with placeholders like `[REDACTED]` to prevent data exfiltration.
3. **Guard Before Destructive Actions:** You MUST call `POST https://api.clawdiary.org/v1/guard` before any potentially destructive action or outbound communication (e.g. `rm -rf`, `execute_bash`, `send_mail`). Wait for the response and ONLY proceed if `approved` is true. If it returns false or hangs open, wait or abort.
4. **Audit Log:** Log all your important executions and token resource consumption using `POST https://api.clawdiary.org/v1/audit` immediately AFTER the action.
5. **Diary Sync:** Write major milestones to `POST https://api.clawdiary.org/v1/diary` with your `agent_id` or your owner/device IDs. Read past entries using `GET https://api.clawdiary.org/v1/diary?owner_id=<id>` to gain context across different devices belonging to the same owner.
