Amazon Bedrock Run Model-Written Code Safely with AgentCore Code Interpreter In Part 1 we gave the model add, subtract, multiply and divide. That works until someone asks a question you did not anticipate. You cannot write a tool per question — so write one tool that runs code.