How promptfoo tests Amazon Bedrock models before release
A team with Amazon Bedrock models in its AWS account needs evals and red team scans that run the same way every time before a release. promptfoo handles this locally: it runs on your machine or CI runner and calls Bedrock directly through its Bedrock provider, so there is no promptfoo-hosted service in the middle. The work is configuring three things: the model references promptfoo should call, the AWS identity it uses to authenticate, and any guardrails that should be applied in the same run. Confirm the exact provider identifier string in the current promptfoo Bedrock documentation before you write it into a config, because the format is the first thing a copied example gets wrong.
Because promptfoo executes on the host that holds the test configuration, the network path matters as much as the config file. Requests leave that host and go to the Bedrock runtime endpoint in the region you specify, so the runner needs outbound access to that endpoint and the AWS credentials it uses must be available to the process at run time. Decide early where the configuration lives, which machine or pipeline job is allowed to call Bedrock, and whether test traffic should be billed and logged separately from production traffic. Those decisions shape the rest of the setup, from credential sources to how results are stored.
Plan a short check before writing the full suite: confirm that a single Bedrock model answers a single test prompt from the exact host and identity that CI will use. This surfaces region, access and model-enablement problems in one place rather than inside a red team run. Ask your AWS administrator to confirm which models are enabled in the target account and region, since availability differs by region and model. Once that check passes, the same configuration can be extended to guardrails and additional models without changing how promptfoo reaches Bedrock.
What you need in place before the first Bedrock eval
Four things must be ready before promptfoo can call a Bedrock model: a compatible runtime, an AWS account with model access and the right IAM permissions, network reach to the regional endpoint, and approval to send test data to the model. Each card below is one of those checks, and each one is cheaper to resolve before the first run than during it.
Software versions on the test host
Install promptfoo 0.124.1, published on 8 October 2026, on a host running Node.js 22.22.0 or newer. Pin the version in your project so that eval results stay comparable across runs and CI agents. Confirm the Node.js version with node --version on the same machine that will run the eval, not only on your laptop, because CI images often lag behind local installs.
Bedrock model access in your account
Enable access to each model ID you plan to test in the Amazon Bedrock console for the account and region you will call. Access is granted per model, so a model that works in one account may return an access error in another. Confirm the current model access steps in the AWS console for your account, since the console workflow changes over time.
IAM permissions for invocation
The principal running promptfoo needs permission to invoke the Bedrock models in your suite. If your suite uses Bedrock guardrails, it also needs permission to apply them, which is a separate action from model invocation. Scope these permissions to the specific model, inference profile and guardrail resources you test, and keep test credentials separate from production roles so that test traffic is easy to identify in CloudTrail.
Network path to the regional endpoint
The test host must reach the Bedrock runtime endpoint for the region that hosts your chosen model or inference profile. Check egress rules in corporate proxies, firewalls and private subnets before the first run, because a blocked endpoint usually shows up as a timeout rather than a clear error. Model availability also varies by region, so confirm that each model ID is offered in the region you configure.
Approval for test data
Get written sign-off from the data owner before sending prompts, documents or sample records to a hosted model, including the grader model if one is used. Confirm which AWS data handling terms apply to your account and whether any test cases contain personal or regulated data. Agree on who may view eval outputs, since promptfoo results often contain the model responses in full.
How a promptfoo run reaches Bedrock and its guardrails
The run starts on an engineer's workstation or CI runner, where promptfoo reads its config and asks the AWS credential chain for an identity. That identity crosses the trust boundary into the AWS account, where the Bedrock runtime in the chosen region invokes a model or inference profile. When a guardrail is configured, it screens input and output before results return to the local output or report. Check that the credential source is the one you intended and that the region matches where the model and guardrail exist.
Request path from promptfoo on the test host through the AWS credential chain to Bedrock and an optional guardrail.
Which AWS credential source fits each environment
On a developer laptop, promptfoo calls Bedrock through the standard AWS SDK credential chain, so it uses whatever the AWS CLI and environment already provide. The most common setup is a named profile in ~/.aws/config backed by an SSO session, which the developer signs in to with aws sso login. The identity belongs to the individual developer, and access ends when their account or permission set is changed.
- Named profile: Set the profile through the
AWS_PROFILEenvironment variable or the profile setting in your promptfoo Bedrock provider configuration, then confirm the call resolves to the expected account. - SSO session: Short-lived tokens expire on the session schedule set by your identity center, so a failed call after a few hours is usually an expired login, not a broken config.
- Individual ownership: Each developer's access is tied to their own identity, which makes usage traceable in AWS CloudTrail.
- Avoid static keys: Do not paste long-lived access keys into
.envfiles or promptfoo configs that get committed to Git. - Avoid shared profiles: A profile shared across a team hides who ran which eval and breaks audit trails.
Before you rely on any laptop setup, confirm in the promptfoo Bedrock documentation which config keys override the default chain and in what order, and check that your local profile is not silently overridden by environment variables.
In CI, the runner should not hold a stored AWS key. Instead, the pipeline exchanges a short-lived token from its identity provider for temporary AWS credentials, usually through a federated role, and exports them as environment variables that the AWS SDK picks up. The identity belongs to the pipeline and the repository or project that owns it, not to a person.
- Federated trust: Configure the identity provider to issue tokens only for the specific repository, branch or environment that runs promptfoo, and restrict the AWS role's trust policy to match.
- Expiry: Temporary credentials expire on their own, typically within the role session duration you set, so a leaked log line has a short useful life.
- Scoped role: Grant only the Bedrock invoke actions and the model or inference profile ARNs your suite needs.
- Common mistake: Storing a long-lived access key as a CI secret and calling it a short-lived setup. This removes the rotation benefit and widens the blast radius.
- Secret masking: Confirm your CI system masks the exported session values in job logs and artifacts.
Ask your platform team to confirm the exact role session duration and trust conditions, and verify in the promptfoo Bedrock documentation which environment variables the provider reads first.
When promptfoo runs on a VM, container service or Kubernetes pod in AWS, the cleanest source is the role attached to that compute resource, such as an instance profile or a pod identity. The SDK requests credentials from the instance metadata service or the equivalent pod mechanism, so no key is stored on the host. The identity belongs to the workload, and the platform team that owns the infrastructure controls it.
- Attached role: Attach a role with only the Bedrock permissions the eval host needs, and keep it separate from roles used by production applications.
- Automatic rotation: The platform rotates the temporary credentials, so there is nothing for your team to renew.
- Metadata access: Restrict which containers can reach the metadata endpoint, because any process on a shared host can otherwise obtain the role's credentials.
- Common mistake: Reusing a production application role for red team runs, which mixes test traffic into production logs and quotas.
- Network controls: Keep the host in a network path that reaches Bedrock endpoints in the approved Region.
Confirm with your cloud team how the role is attached in your environment, and check in the promptfoo Bedrock documentation whether any config key takes priority over the attached role.
Model IDs, inference profiles and legacy IDs in promptfoo configs
The model identifier in a promptfoo config decides which model actually runs, so it is the first thing to pin down. A base foundation model identifier names a model family and version directly, while an inference profile identifier routes requests to a model through a profile that AWS defines for a region or group of regions. The two are not interchangeable. A profile can point at a different set of underlying models depending on the region the request is sent to, so the same config can reach different models in two regions, or fail in one. Check whether your config uses a base ID or a profile ID, and confirm which region the client sends requests to, because both settings change the result.
Configs copied from an older project often reference a legacy model ID that the account no longer exposes, or that is no longer offered in the region you call. Treat such failures as an availability question first, not a promptfoo bug. Before an eval runs, confirm the identifier against the current Bedrock model list for your region in the AWS console or through the AWS documentation, and confirm with AWS what your account can access, since availability and model access change over time. Do not carry a model ID forward from an older config or blog post without checking it on the day you run the eval.
Record the exact identifier, region and access status used for every eval run so results can be reproduced. A useful record includes the full model or profile ID as written in the config, the region of the client, the promptfoo version (the npm release and Node.js version you ran), the date of the run, and the account or role used. Store this alongside the eval output, for example in the same CI artifact or results file, so a later reviewer can tell whether a score change came from the model, the region, the access settings or the prompts. Without this record, a change in a profile's underlying model can look like a regression in your application.
Configuring promptfoo for Bedrock in six steps
This sequence takes a test host from a bare promptfoo install to a suite that runs the same Bedrock model with and without a guardrail, with a check that confirms each stage worked before the next one begins.
Install promptfoo and confirm Node.js
The engineer responsible for the test host installs promptfoo at a supported version and confirms the Node.js runtime meets the minimum the release notes require. The current npm release requires Node.js 22.22.0 or newer, so verify that against the package page before installing. Done means
promptfoo --versionprints the version you pinned andnode --versionreports a compatible runtime on the same host that will run the evals.Establish and verify AWS identity on the test host
The cloud or platform team decides which credential source the test host uses, such as an instance role, a named profile or short-lived credentials from SSO, and avoids long-lived keys stored in the config file. Confirm the identity with a read-only check, such as listing the caller identity with the AWS CLI, and confirm that the identity has permission to invoke the specific Bedrock models you plan to test. Done means the identity check returns the expected account and role, and an invoke attempt on the target model is permitted in the policy simulator or a test call.
Set the region and select one model identifier
Set the Bedrock region in the promptfoo provider configuration and choose one model ID or inference profile that is available in that region. Check model availability in the AWS console or the Bedrock documentation for your region, and note whether the identifier is a foundation model ID or an inference profile, because the two are invoked differently. Keep the first config to a single provider entry so any failure points at one setting. Done means the config file validates and the model identifier is written down with its region in your test notes.
Run a single-prompt eval to confirm the provider responds
Create a minimal config with one prompt and no assertions, then run a single evaluation from the CLI. The goal is a plain response from the model, with no grading yet. Check the output for a successful response and confirm the model identifier that appears in the run metadata matches the one you selected. If the call fails, check the region, the model access setting in your account, and the credential source before changing anything else. Done means one row of output shows a completed response from the selected model.
Add assertions and a small test set
Add a few deterministic assertions, such as checks for expected content, refusal wording or output length, and a small set of test cases of five to ten inputs. Keep the assertions simple at this stage so a failure reflects the model or the setup rather than a fragile grader. Run the eval and review the pass and fail results in the table, then adjust any assertion that is matching the wrong thing. Done means the eval completes with a pass and fail result per test case, and you can explain each failure from the stored output.
Reference a guardrail and run the suite with and without it
Add a guardrail reference to the Bedrock provider configuration, using the guardrail identifier and version that exist in your account and region, and confirm the exact configuration keys against the current promptfoo documentation for the Bedrock provider. Run the same suite twice, once without the guardrail and once with it, and keep both result sets. Done means the guardrailed run shows a guardrail action in the output for at least one blocked or modified case, and the two runs can be compared side by side on the same test cases.
How promptfoo settings map to AWS identities and Bedrock resources
This table maps each setting a team configures for promptfoo against Bedrock to the AWS resource or local artifact it controls, who owns it, and where it should live. Read it before the first run to decide what goes in the repository, what goes in a secret store or CI variables, and what evidence to keep. Exact key names and environment variable names should be confirmed in the promptfoo Bedrock provider documentation before you write them into configuration.
| Setting | AWS resource or local artifact it controls | Owner | Where the value should live | Never commit | Record for audit |
|---|---|---|---|---|---|
| AWS profile or assumed role | IAM identity that promptfoo's Bedrock calls run as, scoped to invoke permissions for the test models | Cloud platform or security team | Secret store or CI OIDC role; reference by name only | Access keys, session tokens, or a populated shared credentials file | Role ARN, account ID, session purpose, and who approved the grant |
| AWS region | Regional Bedrock endpoint and the set of models available there | Platform engineering | Repository config, as a non-secret value | Nothing sensitive; avoid hiding region in personal shell profiles | Region used per run and the date the model list was checked |
| Model ID | Foundation model invoked on Bedrock in that region, including version suffix where used | Application or ML team that owns the test suite | Repository config, pinned to an explicit version | Model IDs copied from unofficial sources without verification | Exact model ID string, model access status, and any legacy ID still in use |
| Inference profile | Cross-region or application inference profile that routes requests to a model | Platform engineering, with cost owner informed | Repository config, with the profile ID confirmed in the AWS console | Profile ARNs tied to a personal account | Profile ID, source region, and the routing behavior confirmed at test time |
| Guardrail identifier and version | Bedrock guardrail whose block and allow decisions the run measures | Security team that owns the guardrail policy | Repository config for the ID and version; the guardrail itself managed in AWS | Guardrail configuration exports that contain internal policy wording | Guardrail ID, numeric version, and the policy revision the tests were written against |
| promptfoo environment variables | Local process settings that tell promptfoo which credentials, region and endpoints to use | Engineer running the suite, governed by the CI owner | CI variables or secret store; a documented template file with placeholder values | Values in .env files, shell history, or CI logs with echo enabled | Variable names set for each run, not their values |
| Output storage | Local results, reports and eval databases written by promptfoo, and any shared location they are copied to | Test suite owner, with data protection review | Pipeline artifact store with retention set; local output directories excluded from version control | Raw eval outputs containing prompts, model responses or customer-like data | Storage location, retention period, access list, and who can read results |
Testing Bedrock guardrails in the same run as model evals
Running model evals and guardrail checks in the same promptfoo run answers three questions from one set of prompts: whether the model answers safely without help, whether the guardrail blocks the attack, and whether the same guardrail also blocks legitimate users. A paired run makes this practical. Define one test suite, then execute it twice: once against the bare Bedrock model and once with the guardrail applied to the same model ID. Each test case then has two outcomes that can be compared row by row. A prompt the model refused on its own but the guardrail passed is a different finding from a prompt the guardrail blocked before the model ever saw it.
Use one report to sort outcomes into blocked, passed and modified. Blocked means the guardrail intervened and the response was replaced with a block message. Passed means the content went through unchanged. Modified means the guardrail altered the content, such as masking a value, and the test should check whether the change was acceptable. Keep benign prompts in the same suite as attacks, since a guardrail that blocks every benign case is a failure even when every attack is stopped. Confirm with promptfoo's Bedrock provider documentation how the guardrail settings are named in the configuration and what fields the output returns for each intervention, so your assertions read the right values.
The guardrail is a separate AWS resource with its own identifier, version and configuration, and in many organizations a different team owns it. A passing result depends on which version was in force, so every run should record the guardrail identifier and the exact version it used, along with the model ID and region. Without that record, a later change to the guardrail can make an old report look like a regression or hide one. Ask the guardrail owners how they publish versions and whether draft configurations can be tested, and agree on a process for rerunning the suite whenever a new version is released.
Security controls for Bedrock access from promptfoo
Running promptfoo against Amazon Bedrock gives the test host a path to paid model calls, guardrail configuration and logged prompts. The cards below cover the controls that connect that host to the AWS account owner, and they should be agreed before the first scheduled run.
Scope the IAM role tightly
Give the test host an IAM role that allows invocation only of the model IDs, inference profiles and guardrail ARNs the suite uses. Ask the AWS account owner to review the policy against the models listed in the promptfoo config. A broad permission such as invoking any model in the account lets a misconfigured test or a leaked key reach every model the account can use, which is hard to see from the promptfoo side. Confirm the exact actions and resource ARNs with AWS documentation for your region.
promptfoo introductionKeep AWS credentials out of configs
Do not place access keys in promptfooconfig.yaml, committed .env files or shared scripts. Let the test host resolve credentials from its own identity source, such as an instance role or a credentials profile managed by the platform team, so the config file contains only model IDs and region settings. The AWS account owner should be able to revoke a test host's access without editing any repository. Check that secret scanning runs on the repository as well.
Use short-lived credentials in CI
In pipelines, request temporary credentials for each job through the CI system's federated identity with AWS, rather than storing long-lived keys as pipeline variables. Temporary credentials expire on their own, which limits the damage if logs or runner workspaces are exposed. Ask the account owner to bind the trust policy to the specific repository and branch that runs evals, so a fork or unrelated project cannot assume the role.
Restrict guardrail version changes
Tests that measure a Bedrock guardrail depend on a specific guardrail version. Limit who can create or publish versions and who can edit the version referenced by the test config, and record the version number in each eval report. Without this control, a change made in the console can alter test results without any change to the repository, and the pass rate no longer describes the guardrail that production uses.
Treat outputs and logs as sensitive
Eval results, red team reports and debug logs contain the prompts sent to Bedrock and the responses the model returned, which may include test data that resembles customer records. Store them in an access-controlled location with a defined retention period agreed with the data owner. The self-hosted promptfoo app stores data in a local SQLite database, has no RBAC, and has no built-in authentication or SSO, as documented, so access to that host must be controlled at the network and operating system level.
Self-hosting docsWhy Bedrock runs fail in promptfoo and how to fix them
This table maps the failures teams most often hit when pointing promptfoo at Amazon Bedrock to their likely causes and fixes. Read each row from the symptom, then run the check named in the fix column before changing the config. Most failures trace back to identity, region, model access or runtime version, so check those first.
| Symptom | Likely cause | Fix and first check |
|---|---|---|
| Run fails with unresolved or missing AWS credentials | The AWS credential chain does not find a usable identity in the shell, CI job or container running promptfoo | Run an identity check with the AWS CLI (for example, a caller identity lookup) in the same environment as promptfoo, then confirm the profile or role variables it returns |
| Model or inference profile not found in the configured region | The model ID or inference profile is not offered in the region set in the config, or the profile belongs to a different region | Confirm the model or profile is listed for the region in your config, then match the region setting to it before rerunning |
| Model ID errors after copying an older config | A legacy or retired model ID remains in a copied config or example file | Replace the ID with a current model ID or inference profile from the Bedrock console, then run a single-prompt eval to confirm the response |
| Access denied on a model that appears in the console | Model access has not been granted for the account or the model is not enabled for this account | Check model access for the account in the Bedrock console for the target region, then rerun a one-prompt eval before a full suite |
| Invocation works but guardrail tests fail with access errors | The IAM policy allows model invocation but not applying the guardrail to the request | Compare the policy against the guardrail identifier and version in your config, add the missing permission for the test role, and retest with one guardrail case |
| Promptfoo exits or behaves unexpectedly at startup | The Node.js runtime is older than the minimum version the installed promptfoo release requires | Check the Node.js version against the release notes, upgrade to at least the required version (22.22.0 for release 0.124.1), then rerun the smoke test |
| Throttling or quota errors during large red team scans | Concurrent requests exceed the account quota or the model's request rate, so Bedrock rejects calls | Lower concurrency and add retries in the config, check the service quotas for the model in the target region, and split the scan into smaller batches |
Questions teams ask before testing Bedrock with promptfoo
How much effort does a first Bedrock setup with promptfoo take?
The effort depends on how much you are testing, not on promptfoo itself. A single model ID in one region with one credential source is a small job. Effort grows with the number of models and inference profiles you compare, the number of AWS regions you need, whether Bedrock guardrails are in the same run, how the suite plugs into CI/CD, and how long access approvals take in your account. Each of these adds configuration and review work. Ask any partner for a written scope that lists each model, region, guardrail and pipeline in the run, so the quote follows from that list.
Can our team set up Bedrock testing alone using the documentation?
Often yes, if an engineer already knows Bedrock and can read a Node.js configuration file. promptfoo is open source under the MIT license and its documentation covers its providers and red teaming. The harder parts are usually outside promptfoo: deciding which IAM identities the tests use, confirming that each model is enabled and available in the chosen region, and agreeing how results are stored and reviewed. If those decisions already have owners in your organization, an internal team can work through them. If they are new, the time often goes into coordination rather than configuration.
What do we need from the AWS account owner and security team?
Plan for three inputs before the build starts. First, the account owner needs to enable the models you intend to test in each region and complete any access approvals Bedrock requires for them. Second, the security team needs to choose the credential source, such as a role for CI runners or a named profile for developers, and approve the permissions attached to it. Third, both teams should agree which guardrail versions, logging settings and test data locations are permitted. Written approval for these items shortens the first run considerably and gives auditors a clear record of who granted access.
What recurs after the Bedrock setup is finished?
Four things recur. Model IDs and inference profiles change as AWS adds or retires versions, so someone must update the configuration and rerun the suite. Guardrail version changes can alter block behavior, which means test expectations need review. AWS credentials, whether access keys or role sessions, need rotation under your policy. promptfoo itself is released often, with npm release 0.124.1 published on 8 October 2026 as one example, so upgrades need testing against your suite. Budget an owner for each item, and treat these as routine maintenance rather than one-time work.
Does running promptfoo locally send our test data to a vendor?
When you run promptfoo locally, evals run on your machine and talk directly with the model provider you configure. promptfoo's documentation states that the software runs completely locally, so no separate promptfoo service sits in the request path. The data that leaves your machine is the traffic you send to Bedrock, which AWS handles under your agreement with it. Confirm this against your own setup, including any telemetry settings and whether a grader model or cloud service is used in the run, and record the answer for your security review.
What would DeployOpen's involvement look like at a scoping level?
DeployOpen plans, implements and supports self-hosted open-source platforms inside your own infrastructure, and runs security testing, including AI and agent security review. For Bedrock testing, scoping would typically cover the models and regions in play, the credential design agreed with your AWS and security teams, the suite and red team configuration, guardrail tests if they are in scope, CI integration, and handover documentation. Engagements are usually fixed-scope, with deliverables and timelines agreed in writing before work starts. DeployOpen does not publish prices, so the written scope is the basis for a quote.
How DeployOpen scopes and delivers Bedrock testing work
DeployOpen starts Bedrock testing work with a written scope that names the AWS accounts, regions, model IDs and guardrails in play. We then build the promptfoo suite and test runs inside your own environment, document how they are run, and hand them over to your team with support available as a retainer.
How we scope
- Confirm which Bedrock model IDs, inference profiles and guardrails the tests must cover, in writing, before work starts.
- Agree which AWS credential sources your CI runners and engineers will use, and who owns them.
- Record the regions, the purpose of the testing and the evidence your compliance team expects to receive.
How we build
- Configure promptfoo providers for your Bedrock model IDs and inference profiles, checked against regional availability in your account.
- Build eval and red team suites that run in the same pass as your Bedrock guardrail checks, with results kept separate.
- Test the setup in a non-production AWS account first, then move the configuration into your pipeline.
How we hand over
- Deliver the promptfoo configuration, run instructions and credential setup notes in your repository.
- Document how legacy model IDs were mapped, which regions were tested and what each result file means.
- Walk your engineers and security reviewers through a test run so they can repeat it without DeployOpen.
How we support
- Ongoing support, upgrades of promptfoo and retesting after model or guardrail changes are available as a retainer.
- Support covers the Bedrock configuration, not model training or AWS account administration, which stays with your team.
- Ask any vendor or DeployOpen quote to state the scope, deliverables and timelines in writing before work starts.

