Skip to content
Back to skills

Aws Bedrock

ASecurity

> **Verification Tier:** `code_example_tested` | **Last Verified:** 2026-11-18 > **Official Docs:** https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html

  • 13 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentsjavascriptjavabashrailsawsapisecurity

Works with

  • cli
  • 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 2 files and shows the line behind each finding

Scanned December 2, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Aws Bedrock?

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

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

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
# AWS Bedrock Runtime Skill

> **Verification Tier:** `code_example_tested` | **Last Verified:** 2026-11-18  
> **Official Docs:** https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html

## Overview
Amazon Bedrock provides managed access to foundation models (Anthropic Claude, Amazon Nova, Meta Llama, Mistral) inside AWS. The unified `Converse` and `ConverseStream` APIs eliminate model-specific JSON payload formatting differences across providers.

## Installation
```bash
npm install @aws-sdk/client-bedrock-runtime
pip install boto3
```

## Authentication
Use AWS IAM Roles (ECS Task Role, Lambda Execution Role, EKS IRSA, or SSO profiles) with AWS Signature Version 4. Grant least-privilege `bedrock:InvokeModel` and `bedrock:InvokeModelWithResponseStream` permissions scoped to specific model or inference profile ARNs. Never embed long-lived static `AWS_SECRET_ACCESS_KEY` values in code.

## Core Concepts
- **`ConverseCommand` / `ConverseStreamCommand`**: Unified message, system prompt, guardrail, and tool-calling contract across supported Bedrock models.
- **Cross-Region Inference Profiles**: Newer models often require inference profile IDs (e.g., `us.anthropic.claude-sonnet-4-20250514-v1:0`) rather than bare on-demand model IDs.
- **Bedrock Guardrails**: Apply server-side content filtering and PII redaction via `guardrailConfig`.

## Error Handling & Rate Limits
- Handle `ThrottlingException` (HTTP 429) and `ServiceUnavailableException` (HTTP 503) using AWS SDK adaptive retry mode (`retryMode: "adaptive"`, `maxAttempts: 5`).
- Check `response.stopReason` (`end_turn`, `tool_use`, `max_tokens`, `guardrail_intervened`).

## Security Best Practices
- Use VPC Interface Endpoints (AWS PrivateLink) to keep prompts off the public internet.
- Scope IAM policy resources to explicit model/inference-profile ARNs rather than `Resource: "*"`.
- Enable CloudWatch Model Invocation Logging only with PII-safe S3 buckets and KMS encryption.

## AI Pitfalls
- Using legacy `InvokeModelCommand` with brittle provider-specific JSON bodies instead of `ConverseCommand`.
- Passing bare foundation model IDs when the model requires a regional inference profile ID (`ValidationException`).
- Instantiating `new BedrockRuntimeClient()` inside a Lambda handler instead of reusing a module-scoped client.

## Production Checklist
- [ ] IAM role uses least-privilege model/inference-profile ARNs
- [ ] `ConverseCommand` / `ConverseStreamCommand` used with explicit `inferenceConfig.maxTokens`
- [ ] Adaptive retries enabled for `ThrottlingException`
- [ ] Region and inference profile IDs configured via environment variables

## References
- [Bedrock Converse API](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html)
- [AWS SDK v3 Bedrock Runtime](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-runtime/)

## Related skills
- [`aws-lambda`](../aws-lambda/SKILL.md) — works well with
- [`aws-s3`](../aws-s3/SKILL.md) — works well with
- [`anthropic`](../anthropic/SKILL.md) — integrates with

Files in this skill

  • SKILL.md3 KB
  • examples/quickstart.ts949 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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

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