Skip to content
Back to skills

Anthropic

ASecurity

Anthropic's API provides access to the Claude 3 family (Opus, Sonnet, Haiku). This skill focuses on the Messages API, vision capabilities, and strict system prompt isolation.

  • 13 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 5, 2026
ai-agentsbashapisecurity

Works with

  • api

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 8 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add ashish7802/awesome-api-skills --skill anthropic --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Anthropic?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Anthropic
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ashish7802-anthropic/badge)](https://www.skillsdirectory.com/skills/ashish7802-anthropic)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Anthropic API Skill

## Overview
Anthropic's API provides access to the Claude 3 family (Opus, Sonnet, Haiku). This skill focuses on the Messages API, vision capabilities, and strict system prompt isolation.

## Installation
```bash
npm install @anthropic-ai/sdk
pip install anthropic
```

## Authentication
Use the `x-api-key` header with your `ANTHROPIC_API_KEY`. You must also supply the `anthropic-version` header (e.g., `2023-06-01`).

## Core Concepts
- **System Prompt**: Isolated from the main conversation array for higher adherence.
- **Claude 3.5 Sonnet**: The recommended default model for speed and coding intelligence.
- **Max Tokens**: Required parameter defining the generation limit (e.g., 4096 or 8192).

## Common Workflows
1. Define the system prompt.
2. Pass the conversation history alternating precisely between `user` and `assistant`.
3. Process the response blocks.

## Error Handling
Handle `AnthropicError`. The `OverloadedError` indicates capacity constraints; retry with backoff. `AuthenticationError` indicates invalid or revoked keys.

## Security
Anthropic provides inherent safety filters. Ensure system prompts instruct the model to avoid executing unverified external data.

## Rate Limits
Tiered rate limits applied per minute (RPM) and tokens per minute (TPM). Tier 1 for Claude 3 Sonnet is 50 RPM and 40,000 TPM.

## Best Practices
Always put long reference documents inside `<documents>` XML tags. Claude is specifically trained to parse and pay closer attention to XML structures.

## Troubleshooting
If the API returns a 'roles must alternate' error, ensure your `messages` array strictly follows a `user` -> `assistant` -> `user` sequence without duplicate consecutive roles.

## References
- [API Reference](https://docs.anthropic.com/en/api/getting-started)

## Why use this skill
Use this when your agent works with **anthropic** — structured patterns beat pasted docs and prevent common hallucinations.

## AI pitfalls
- Using deprecated model IDs or wrong API endpoints
- Confusing chat vs completions vs embeddings APIs
- Omitting rate-limit and token budget handling

## Production checklist
- [ ] Secrets in environment variables, not source code
- [ ] Error handling and logging in place
- [ ] Rate limits and timeouts configured

## Related skills
- No graph relationships yet — see the knowledge graph in the docs site.

---
> **Last Verified:** 2026-07-02

Files in this skill

  • SKILL.md2.4 KB
  • examples/basic.ts42 B
  • examples/example.py47 B
  • examples/example.ts77 B
  • prompts/system.md44 B
  • prompts/xml-parsing.md149 B
  • tests/skill.test.ts32 B
  • tests/validation.test.ts107 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.