Skip to content

[bot] Instrument AWS Bedrock AgentCore (1,161,890 weekly downloads) #767

Description

@braintrust-bot

Summary

bedrock-agentcore is AWS's official Python SDK for Amazon Bedrock AgentCore — a distinct service from Bedrock's foundation-model invocation APIs, purpose-built for deploying and running agent workloads (agent runtimes, sessions, memory, browser/code-interpreter tools). This repository already instruments bedrock-runtime (Converse/InvokeModel) via py/src/braintrust/integrations/bedrock_runtime/, but has zero instrumentation for the separate AgentCore surface.

bedrock-agentcore was last released 2026-09-11 (v1.23.0) and is under active development.

Why this is not already covered

I read py/src/braintrust/integrations/bedrock_runtime/patchers.py. Its client-detection check is:

def _is_bedrock_runtime_client(client):
    ...
    return getattr(service_model, "service_name", None) == "bedrock-runtime"

This narrowly matches only the bedrock-runtime boto3 service. A boto3.client("bedrock-agentcore") client, and the standalone bedrock-agentcore SDK's BedrockAgentCoreApp, are structurally different clients/entrypoints and are never touched by this patcher. A full repo grep for agentcore/agent_core/agent-core under py/ returns zero matches.

What needs to be instrumented

Server-side hosting (the bedrock-agentcore PyPI package):

  • BedrockAgentCoreApp + @app.entrypoint — the async handler that receives an invocation request and streams the agent's response back. This is the primary execution surface a user's agent code runs through when deployed on AgentCore Runtime, regardless of which agent framework (Strands, LangGraph, CrewAI, AutoGen, custom) built the underlying agent.
  • MemoryClient, Gateway, Code Interpreter, and Browser tool clients — secondary execution surfaces (persistent memory retrieval/storage, sandboxed code execution, cloud browser automation) invoked from within agent code.

Client-side invocation (boto3 bedrock-agentcore service, distinct from bedrock-runtime):

  • client.invoke_agent_runtime(agentRuntimeArn=..., payload=..., runtimeSessionId=..., qualifier=..., ...) — invokes a deployed agent runtime and returns a StreamingBody response (streaming supported); this is the "call this agent" entrypoint analogous to Converse/InvokeModel on the model-invocation side, but for a full agent execution rather than a single model call.
  • Related runtime methods on the same client: invoke_agent_runtime_command, invoke_browser, invoke_code_interpreter, invoke_harness.

Weekly downloads

Weekly downloads: 1,161,890 (as of 2026-09-14; https://pypistats.org/api/packages/bedrock-agentcore/recent)

Braintrust docs status

not_found — checked https://www.braintrust.dev/docs/guides/tracing/integrations. The integrations list covers OpenTelemetry, Vercel AI SDK, LangChain family, LlamaIndex, agent frameworks (OpenAI Agents SDK, Claude Agent SDK, Google ADK, Strands Agents SDK, LiveKit Agents, Pydantic AI, CrewAI, AutoGen, AgentScope, etc.), but no AWS, Bedrock, or AgentCore entry of any kind.

Upstream sources

Local repo files inspected

  • py/src/braintrust/integrations/bedrock_runtime/patchers.py — confirms the existing patcher only matches service_name == "bedrock-runtime"
  • py/src/braintrust/integrations/bedrock_runtime/__init__.py, tracing.py — no AgentCore handling
  • py/src/braintrust/integrations/ — no bedrock_agentcore/ or agentcore/ directory
  • py/pyproject.toml [tool.braintrust.matrix] — no bedrock-agentcore entry
  • py/noxfile.py — no test_bedrock_agentcore session
  • Repo-wide case-insensitive grep for agentcore, agent_core, agent-core under py/ — zero matches

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions