# Amazon Bedrock AgentCore
> Fully managed Browser and Code Interpreter tools for AI agents. Browser is a fast and secure cloud-based runtime for interacting with web applications, filling forms, navigating websites, and extracting information. Code Interpreter provides an isolated sandbox for executing Python, JavaScript, and TypeScript code to solve complex tasks.

- **Package:** bedrock-agentcore
- **Author:** Amazon
- **Tags:** code-execution, browser-automation, sandbox

## Environment Variables
- `AWS_ROLE_ARN`

## Included Tools
- **CodeInterpreterTools:** Execute Python, JavaScript, and TypeScript code in an isolated sandbox environment
- **BrowserTools:** Interact with web applications, fill forms, navigate websites, and extract information

## Installation
```bash
npm install bedrock-agentcore
```

## Usage
```typescript
import { generateText, stepCountIs } from 'ai';
import { bedrock } from '@ai-sdk/amazon-bedrock';
import { awsCredentialsProvider } from '@vercel/oidc-aws-credentials-provider';
import { CodeInterpreterTools } from 'bedrock-agentcore/code-interpreter/vercel-ai';
import { BrowserTools } from 'bedrock-agentcore/browser/vercel-ai';

const credentialsProvider = awsCredentialsProvider({
  roleArn: process.env.AWS_ROLE_ARN!,
});

const codeInterpreter = new CodeInterpreterTools({ credentialsProvider });
const browser = new BrowserTools({ credentialsProvider });

try {
  const { text } = await generateText({
    model: bedrock('us.anthropic.claude-sonnet-4-20250514-v1:0'),
    prompt: 'Go to https://news.ycombinator.com and get the first story title. Then use Python to reverse the string.',
    tools: {
      ...codeInterpreter.tools,
      ...browser.tools,
    },
    stopWhen: stepCountIs(5),
  });

  console.log(text);
} finally {
  await codeInterpreter.stopSession();
  await browser.stopSession();
}
```

## Links
- [Documentation](https://github.com/aws/bedrock-agentcore-sdk-typescript)
- [npm](https://www.npmjs.com/package/bedrock-agentcore)
- [GitHub](https://github.com/aws/bedrock-agentcore-sdk-typescript)

---
[Full Library Index](/library.md)