A single model is a bad critic of its own work. Ask it to find the holes in a plan it just wrote and it will nod along, because the same blind spot that produced the plan is doing the reviewing. What works better is a second model from a different family, prompted to attack. Their disagreement is not proof of anything on its own -- a cross-family model can also just be wrong in a fresh direction -- but it is a cheap way to surface the objection you were never going to raise against yourself.

I run this as a debate: I state a position, an independent model tears into it, we go a few rounds, and I keep whichever design survives. The obvious way to wire up the adversary is a little bridge script to the OpenAI API with your own key. It works. It also has two problems that get worse the more you use it. You pay for every round out of pocket, and the whole loop runs outside whatever cloud account your team actually operates in, so nobody but you can see it happening.

Both problems have the same fix: point the adversary at a model on Amazon Bedrock and reach it with AWS credentials you already have. No personal key, and the spend lands on an account your team can see and budget instead of on your credit card. Here is how to build that, and the parts that bit me.

Bedrock is one backend for the debate. If you'd rather keep the whole thing on your team's Cursor account, or reach an OpenAI model instead -- and see the six debate modes and the source-checking companion skill -- I wrote up the full pattern in Build Your Own Agent Skills: Model-Debate and Content-Matter-Expert. This piece is the Bedrock-specific deep-dive.

your side the agent you reason with, plus a skill that holds the loop -- it never mentions bedrock
bedrock_bridge.py two subcommands, model and ask -- credentials come from the default AWS chain, never from the file
converse api one request shape for every family, so the adversary is a model id, not a rewrite
the shared account attributed to a role, budgeted and visible -- not on your card
the whole rig. the bridge is the only piece that knows about AWS, and it holds no secret of its own -- swap it and nothing upstream notices.

Keep the adversary a different family

First, the thing that is easy to get wrong. The value of this whole exercise is independence. If your primary agent is a Claude model and you point the adversary at another Claude model, you have not bought much. They share training lineage and they tend to share blind spots, so they agree in exactly the places you needed a fight.

So when you pick the Bedrock model, pick a different family than whatever is driving your side. If you reason on Claude, make the adversary an OpenAI-family model like gpt-oss-120b, or a Llama, or a Nova. The point is not that one is smarter. It is that a model trained differently argues from a different place, and that is what surfaces the blind spot. Family is a lever, not a guarantee -- a same-family model tuned differently can still put up a fight, and the critic prompt you write (tell it to concede what is right and hunt only for real defects) matters as much as which model you point at. But different lineage is the easiest independence to buy, and Bedrock hosting a spread of families is what makes it a one-line change.

The bridge

The adversary lives behind a tiny script with two subcommands: model prints which model it will use, and ask reads a chat request as JSON on stdin and prints the reply as plain text. Keeping the interface that small means the thing calling it does not care whether the reply came from OpenAI or Bedrock. You can swap the backend without touching anything upstream.

The one real decision is which Bedrock API to call. Use Converse, not InvokeModel. InvokeModel takes a different request body for every model family, so the day you switch the adversary from a Claude model to a Llama you are rewriting the payload. Converse normalizes the request and response across families, so the same code targets any of them by changing the model id. It does not erase every difference -- system-prompt handling, tool use, and stop reasons still vary by provider, and you will feel that the moment you push past plain text -- but for a text-in, text-out debate turn it is exactly the flexibility you want, and far less code to keep alive.

#!/usr/bin/env python3
# bedrock_bridge.py -- pipe a chat request to a Bedrock model via Converse.
# Credentials come from the default AWS chain (env vars / SSO). No key of your own.
# Subcommands:
#   model   print the model id that will be used
#   ask     read {"system"?, "messages":[{role,content}...], "model"?} on stdin,
#           print the reply text

import json
import os
import sys

import boto3
from botocore.exceptions import BotoCoreError, ClientError

DEFAULT_MODEL = "openai.gpt-oss-120b-1:0"
DEFAULT_REGION = "us-east-1"

# Creds missing or expired -- almost always fixed by logging in again.
_EXPIRED_CODES = {"ExpiredTokenException", "UnrecognizedClientException"}


def model_id():
    return os.environ.get("BEDROCK_BRIDGE_MODEL", "").strip() or DEFAULT_MODEL


def ask():
    req = json.load(sys.stdin)
    mid = (req.get("model") or "").strip() or model_id()
    region = os.environ.get("BEDROCK_BRIDGE_REGION", "").strip() or DEFAULT_REGION

    messages = [
        {"role": m["role"], "content": [{"text": m["content"]}]}
        for m in req.get("messages", [])
    ]
    if not messages:
        sys.exit("No messages provided.")

    kwargs = {
        "modelId": mid,
        "messages": messages,
        # Generous: reasoning models can spend much of this allowance on hidden
        # reasoning, and a truncated rebuttal is worse than a slightly larger ceiling.
        "inferenceConfig": {"maxTokens": 8000},
    }
    system = req.get("system")
    if system:
        kwargs["system"] = [{"text": system}]

    client = boto3.client("bedrock-runtime", region_name=region)
    try:
        resp = client.converse(**kwargs)
    except ClientError as e:
        code = e.response.get("Error", {}).get("Code", "")
        if code in _EXPIRED_CODES:
            sys.exit("Bedrock call failed -- your AWS creds look expired or unset. Re-auth and retry.")
        if code == "AccessDeniedException":
            # Authenticated but refused: invoke permission, model access, or an org policy.
            sys.exit("Bedrock refused this call -- you are signed in but not allowed. "
                     "Check invoke permission, model access, and any org-level deny.")
        sys.exit(f"Bedrock error: {e}")
    except BotoCoreError as e:
        sys.exit(f"Bedrock transport error: {e}")

    # A debate turn is text. Deliberately ignore any non-text content blocks.
    blocks = resp["output"]["message"]["content"]
    text = "".join(b.get("text", "") for b in blocks).strip()
    if not text:
        sys.exit("No text in response:\n" + json.dumps(resp, indent=2, default=str))
    print(text)


def main():
    cmd = sys.argv[1] if len(sys.argv) > 1 else ""
    if cmd == "model":
        print(model_id())
    elif cmd == "ask":
        ask()
    else:
        sys.exit("Usage: bedrock_bridge.py {model|ask}")


if __name__ == "__main__":
    main()

Two things carry the design. Credentials come from boto3's default chain, so whatever put an AWS session in your shell -- exported keys, an active SSO login, an AWS_PROFILE you set -- is what the bridge uses, and no secret ever lands in the file. (That assumes you run it locally against your own session; drop the same script into a deployed context and the chain picks up an instance or task role instead, which is fine as long as you know which identity actually answered.) The model id is then overridable three ways: the model field on the request wins, then a BEDROCK_BRIDGE_MODEL environment variable, then the default. That order lets a single debate pin a specific adversary while everything else keeps the default.

Smoke it before you build anything on top:

python3 bedrock_bridge.py model
# openai.gpt-oss-120b-1:0

echo '{"system":"You are terse.","messages":[{"role":"user","content":"Reply with the single word: ready"}]}' \
  | python3 bedrock_bridge.py ask
# ready

If the second command errors on credentials instead of printing a word, stop and fix the AWS session now. Nothing downstream works until that call does.

Wire it into the loop

The bridge is the plumbing. The debate is the part you actually use, and it is simpler than it sounds:

  1. State your position. Write your real argument, specific and falsifiable. "We should send every model the same prompt because tuning per model confounds the comparison" is a position. "We should think about prompts" is not.
  2. Call the adversary. Hand it your position plus the full running transcript, with a system prompt that tells it to be a sharp, candid critic and to concede what is genuinely right rather than argue for sport. Pass the whole transcript every turn -- the model only knows what you send it, so dropping context is the fastest way to get a shallow rebuttal.
  3. Answer the strongest hit, then go again. Concede or rebut, out loud -- but check the hit before you fold to it, because a fluent critic will now and then manufacture an objection that sounds devastating and is simply wrong. Repeat until two rounds in a row surface nothing new, then stop. Cap it around five rounds so a stubborn loop cannot run forever, and remember you are resending the whole transcript every turn, so the calls get longer and pricier as you go.
  4. Synthesize. Write down what you both converged on, where you still disagree and the best case for each side, and the actual decision. Take a position. Do not end on "there are tradeoffs."
you        state the position -- specific enough to be wrong
   |
   v
adversary  different family, prompted to attack and to concede
   |        what is right. gets the whole transcript again every
   |        round, so each round runs longer and costs more
   v
you        check the strongest hit, then concede or rebut
   |
   +--> something new surfaced      loop back up
   |
   +--> two quiet rounds in a row   stop, then synthesize: what you
        (or five rounds, hard cap)  converged on, what is still open,
                                    the decision -- to a dated file
the loop, and the two ways out of it. the transcript is what grows -- it is both the reason the later rounds cost more and the artifact you keep.

The adversary turn is one call:

REQ="$(mktemp)"
cat > "$REQ" <<'JSON'
{
  "system": "You are a sharp, candid critic debating another engineer. Argue against the position below. Be concrete, cite specifics, concede what is genuinely right, and do not be sycophantic.",
  "messages": [
    {"role": "user", "content": "<your position + the task + the transcript so far>"}
  ]
}
JSON
python3 bedrock_bridge.py ask < "$REQ"
rm -f "$REQ"

If you drive this from a coding agent with a skill or command system, the skill is thin: it holds the loop, the modes (peer critique, straight pro/con, a third skeptic that attacks the points you and the adversary agree on), and the instruction to save the transcript to a dated file. All the model-specific work already lives in the bridge, so the skill never mentions Bedrock at all. That separation is the point -- swap bedrock_bridge.py for the old OpenAI bridge and the skill does not notice.

Save every debate to a dated markdown file. The transcript is the artifact: it is the reasoning behind a decision, captured while the decision was still open instead of reconstructed after something broke.

The parts that bit me

SSO credentials expire, usually mid-debate. Short-lived session credentials are the normal case for anything sane, and a good debate can outlast them. When a round dies on an expired-token error, that is not a bug in your bridge -- re-auth and re-run that one turn. The bridge above translates the AWS error into a plain re-auth message precisely so you do not go hunting for a problem that is not there. If your sessions are short, log in right before you start.

Some models will not answer on their bare id. A model can be listed and enabled in your account and still reject an on-demand call, because it is only reachable through a cross-region inference profile -- an id prefixed with us. or global. that routes across a region group. When I was doing this, gpt-oss-120b in us-east-1 took its bare id, while several Llama, Nova, and Claude ids did not and needed the profile id instead -- but which model needs which shifts by region and over time, so treat those specifics as a snapshot, not a rule. If your first call to a new adversary throws a validation error about on-demand throughput, that is the usual tell. Send the profile id and it clears.

Reasoning models spend your token budget before they answer. A model that thinks before it responds can burn part of the output allowance on reasoning you never see, so a maxTokens that looks generous for a paragraph of critique can leave nothing for the critique itself, and the visible rebuttal comes back short or empty. Whether that hidden work also bills as output depends on the model, so treat the number as a generation limit to protect first and a cost knob second. That is why the bridge asks for 8000 rather than something tidy: a slightly larger ceiling beats a cut-off argument.

The account is the point, so check who you are. The reason to do any of this is that the calls run where your team can see them -- attributed to a role in CloudTrail, showing up in the account's cost reporting -- instead of on a personal key that is invisible to everyone but you. That only holds if you are calling as the role you think you are, and if that role is actually allowed to invoke the model: it needs Bedrock invoke permission and model access enabled, and an org-level policy can still deny it no matter how your own IAM reads. One aws sts get-caller-identity before a session tells you who you are; the first real call tells you whether you are allowed. If either surprises you, everything downstream is landing somewhere you did not intend.

expired / bad token   session died mid-debate  re-auth, re-run that turn
access denied         signed in, not allowed   check invoke, model access, org deny
on-demand throughput  bare id will not route   send the us. or global. profile id
empty or short reply  reasoning ate maxTokens  raise the ceiling, do not tidy it down
four failures that look like a broken bridge and are not. the left column is what you see, the middle is what actually happened, the right is the whole fix.

The takeaway

A debate partner is worth building, and the backend it runs on is a real choice, not a detail:

  1. Make the adversary a different model family than your own side, or you have bought agreement dressed up as review.
  2. Reach it through Bedrock's Converse API on your existing AWS credentials. The cost does not vanish -- Bedrock still bills it -- but it moves onto the shared account, where it is budgeted and visible, instead of onto your personal card where nobody else can see it.
  3. Keep the bridge tiny and the interface fixed, so the backend is swappable and the skill above it never has to care.

The move that makes all three work at once is small: one script, the default credential chain, and a model from a family that will actually argue with you.

When this isn't worth it

If you are hacking on a personal project with no team account and no one to answer to on spend, the personal-key bridge is less setup and you should just use it. This pays off when the calls should live on shared infrastructure -- when someone else is footing the bill, when there is an audit trail you are supposed to be inside, or when you are making a decision you will have to defend later and want the argument on the record. That is exactly when "it runs on my personal key" stops being a convenience and starts being the thing you have to explain.