
72 Hours of Agentic Football: From AWS AgentCore Harness to a Full Observability Toolchain
How our AWS China UG community pre-tested the Agentic Football Cup workshop — deterministic overrides, player heatmaps, an autopilot tuning loop, and 19 matches ground out with Playwright.

Image source: agenticfootballcup.com
When: July 3, 2026 4PM — July 6, 2026 4PM (72 hours)
Organizer: Amazon Web Services China User Group
Goal: De-risk the first Agentic Football Cup Beijing UG Workshop
Wrap-up: Community live stream on July 5 at 8PM
What is the Agentic Football Cup?
Agentic Football Cup is a free half-day workshop (~4 hours) from AWS with a very direct tagline — Build AI Agents. Watch them compete. Through a 2D pixel-art football game you get hands-on with Amazon Bedrock AgentCore, CloudWatch, and related Agentic AI services: every player on the pitch is an autonomous AI agent. No scripts, pure emergent play.
As the official agenticfootballcup.com/learnmore/ page puts it, "the football is the learning vehicle" — every pattern used in the match maps to a production agentic workload:
- Format: free half-day (~4h); private sessions for orgs or public sessions for individuals
- Reach: regular workshops in major cities worldwide (Shanghai and Beijing both on the list), in EN / JA / KO / ES / PT-BR
- What you learn: multi-agent coordination and orchestration, real-time state management, tool use and structured output, guardrails and retry strategies, observability and debugging agent reasoning, prompt engineering for autonomous systems
- Tech stack: Amazon Bedrock, Bedrock AgentCore (managed runtime), Strands Agents SDK, Kiro IDE, Nova / Claude or any Bedrock model — deployed in your own AWS account
- Architecture: 10 autonomous agents called in parallel every 2 seconds, each decision targeted under 500ms
- Touchline coaching: type instructions from the sideline mid-match and watch your agents reason about whether to follow them
Signup (public session or private booking) takes a minute on the agenticfootballcup.com.
From your laptop to Las Vegas
This deserves its own highlight — finishing the workshop is not the end, it is the entry ticket to the global league:

Image source: agenticfootballcup.com/learnmore
- Complete a Workshop — private or public session, build and deploy your agentic football team
- Compete in the Day-of Tournament — your agents face off against other participants live at the end of the workshop day
- Enter the Global League Qualifying — all workshop completers are eligible for the virtual qualifying tournament; keep improving your agents and compete globally
- 🏆 AWS re:Invent 2026 · Las Vegas — group winners play for the grand prize, live on stage at the world's largest cloud conference
In the official words: "The path is real — build something great in the morning, qualify in the afternoon, and there's a route from your laptop to Vegas."
The game in one paragraph
Matches are 5v5: GK / DEF / MID / FWD1 / FWD2. The key idea — every player is an independent agent deployed on AgentCore Runtime, with its own system prompt, its own model, its own fallback rules, invoked independently on every decision tick. You are not "playing a game"; you are operating five production agents at once. The Portal even gamifies AgentCore's capability map: the trophy wall corresponds to Runtime, Memory, Code Interpreter, Browser, Identity, Gateway, Observability, Bedrock, Guardrails, and Evaluations.
There are three ways to create agent players:
- AgentCore Harness (GUI): quick start, configure prompts and models in the browser, no local setup
- CloudShell: one-shot deploy from the cloud terminal
- Local deploy (Kiro or any IDE): develop agent code locally, push to AgentCore Runtime — full control
We used Harness first, then switched to local deploy. Harness validates the happy path in an hour or two; local deploy unlocks everything below: an observability platform, heatmaps, AI tuning advice, deterministic overrides, and Playwright automation.
Our 72-hour timeline
- Jul 3, 4PM — workshop kickoff; Harness smoke test; switch to local deploy
- Jul 4–5 — observability dashboard, CloudWatch analysis, blast-shot override, prompt tuning, Playwright match grinding
- Jul 5, 8PM — community live stream
- Jul 6, 4PM — pre-test ends
Phase 1: Harness quick validation
With AgentCore Harness we created and deployed agent players entirely in the browser — write the player prompt, pick a model, deploy. It confirmed three things: AgentCore Runtime accepts match requests, the Portal runs games and emits DECISION logs to CloudWatch, and basic prompt / fallback flows work. About 1–2 hours, and it builds the mental model for local development.
Phase 2: local deploy and game mechanics
One team = five independent agents
The "My Team" page makes the architecture explicit: every player card is bound to an Agent ARN on AgentCore Runtime, showing live invocation counts, token usage, response latency, and a pre-match fitness check.

Formation 1-2-1. Latency is a stat: slow agents miss decision windows and it shows on the pitch.
The repo ships several team templates —
balanced , extremely-aggressive , extremely-defensive , gateway , memory — deployable as a whole squad via one script.How a match runs: ~2 seconds per tick
The match clock runs about 120 seconds, advancing one tick every ~2 seconds. On each tick all five players invoke their agents and return one command each:
MOVE_TO , PASS , SHOOT , MARK , SLIDE_TACKLE , PRESS_BALL , INTERCEPT , GK_DISTRIBUTE , CLEAR … A full match adds up to 300–600 agent invocations per team. Responses slower than ~900ms risk timing out, in which case the game falls back to deterministic rules — a well-written prompt matters exactly as much as a fast response.
Note the coach shout box at the bottom left — you can send natural-language tactical instructions mid-match. It returns in our Playwright experiment later.
Post-match reports and "Behind the Scenes"
Every match produces two layers of reporting. The first is the full-time page: winner, MVP, fastest agent, possession, shots, goal timeline.
The second layer, Behind the Scenes, is written for agent developers: an AI-generated match summary, per-goal narratives, a command breakdown for both teams, and per-position latency and success rates.
This report earns its keep. In the 2-1 win above, our team averaged 1049ms per command against the opponent's 550ms, and our DEF spiked to 1333ms — we won on tactics while losing on latency. That observation directly drove two next steps: faster models per position, and building our own observability platform.
Overrides: the blast shot
The game lets agent code apply deterministic overrides — tactical actions taken by code, bypassing the LLM. We gave our forwards a blast shot: inside the shooting zone with a good angle, the code fires
SHOOT at full power with zero LLM hesitation. It measurably raised goals and win rate. The division of labor became clear: the LLM reads the game, the code pulls the trigger.Prompt and fallback tuning
- Prompts: push forwards, link midfield, mark tightly, cut useless sideways passes
- Output format: LLMs occasionally chat outside the JSON, breaking parsing — our dashboard later turned this into an alert
- Fallbacks: deterministic rules when the LLM times out or returns an invalid action. But fallbacks cut both ways — in training mode we once caught the team playing entirely on rules with 0% LLM decisions (more below)
Per-position model selection
With latency numbers in front of us, we benchmarked candidates and settled on: FWD / MID on
nova-2-lite (stronger reasoning for attacking decisions), DEF / GK on nova-micro (lower latency for defensive reactions). Goalkeepers must answer inside the tick window; this split held up in practice.
Phase 3: the observability platform
The biggest payoff of going local: you can pull CloudWatch DECISION logs and Portal results into your own analysis. We built and open-sourced an observability toolchain with a bilingual English/Chinese UI.
The data flow: AgentCore Runtimes emit one DECISION line per tick to CloudWatch → the dashboard downloads and caches them locally → a Playwright grinder records match results → analytics joins the two → Bedrock generates tuning advice.
Dashboard home: five position cards + latency scatter

One card per position: ticks, LLM decision share, p50/p95 latency, code override count, command mix, and auto-generated health hints such as:
- DEF card:
parse-fallback 34/255: LLM output drifting from pure JSON — tighten the response format section or lower temperature
- GK card:
GK never used GK_DISTRIBUTE — distribution priority may not be firing
Below sits the LLM latency scatter (colored by position, dashed line at the 900ms timeout-risk threshold) and the team-wide command mix.
Training mode caught us red-handed
The dashboard supports three data sources: Live (CloudWatch), Training ground (local logs), and a side-by-side comparison.

Training mode earned its keep immediately: in the session above, all five cards flagged
only 0% decisions from LLM — the team is effectively playing on rule-based fallback . We thought we were testing prompts; we were actually testing rules. Without observability, that failure mode is nearly invisible.
Edit a prompt, verify on the training ground, then check against live data. That is the iteration loop.
Splitting the sessions
Here is a trap every team will hit: the game clock
t in CloudWatch DECISION logs does not reset between matches. Grind a dozen games and a naive analysis merges them into one 7000-tick "supermatch". Our fix: split by the time windows recorded in grind_results.jsonl (start/end of every grind session), so the analytics dropdown correctly lists 2-1, 6-5, 4-3… as separate matches.
Player heatmaps

Heatmaps aggregate player coordinates from the DECISION logs, filterable by position. The per-player panel reports average position, distance to both goals, half split, shot discipline, override counts, and command mix.
The finding in this screenshot is a classic: FWD1's shot attempts cluster near the center circle — far too far out to convert. That single observation became the next prompt edit: "only shoot near the box."
AI tuning advice

The "AI tuning advice" button sends the current match's stats and DECISION samples to Bedrock and returns targeted suggestions in 20–40 seconds — which prompt to tighten, which position deserves a faster model, which override to add. The analysis model itself is switchable (Nova 2 Lite, Nova Micro, Claude Sonnet, Llama…) — comparing how different models coach the same match is a fun side quest.
Local-first data strategy

The dashboard reads a local
cloudwatch_logs/ cache on startup instead of hitting the CloudWatch API (fast, cheap, works offline); one click syncs new data. Credentials support the workshop's temporary STS tokens and are written only to the local ~/.aws/credentials .
Phase 4: Playwright automation
Match grinding
Analysis needs data. A manual match takes half a dozen clicks plus four minutes of waiting, so we wrote a Playwright bot that drives the Player Portal — log in → schedule → watch → record the score — for N matches in a loop.

Over 72 hours we ground out 19 ranked matches (5W 1D 13L — a 26% win rate and 5th place; the data does not flatter us, but every match became a training sample). The repo also ships a more aggressive
autopilot.py : a fully automated schedule → pull logs → analyze → tune → redeploy loop.Live coach injection (experimental)
Remember the coach shout box? We tried using Playwright to inject tactical prompts mid-match automatically. The road was bumpier than expected and produced three findings:
- Free text gets rejected with a 400 — the shout channel only accepts 6 preset instructions (press_high, shoot_on_sight, slow_the_tempo, go_all_out_attack, …)
- Orders sent at the goal moment get swallowed — anything injected during the goal replay / kickoff cutscene vanishes; orders must be queued until the game clock resumes
- Delivery can be proven — we added a
co:1field to the DECISION log that fires only when a coach order actually reaches the LLM prompt
Those findings became the
LiveCoach class (below), but the win-rate impact is still inconclusive — more matches needed. PRs welcome.
Code walkthrough: how the agents are actually built
Best read side by side with the repository github.com/peterpanstechland/sample-ai-possibilities/tree/football-workshop/agentic-football-sample-agents
Repository map
agentic-football-sample-agents/
├── ai-team-strands-extremely-aggressive/ # main squad: one agent per position
│ └── ai-gk/ ai-def/ ai-mid/ ai-fwd1/ ai-fwd2/
│ └── src/main.py # ~80 lines each: prompt + three configs
├── lib/ # shared core (the interesting part)
│ ├── agent_base.py # pipeline: LLM → parse → override → DECISION log
│ ├── state.py # compresses gameState into the prompt
│ ├── tactics.py # inline tactical math: shot odds / best pass
│ ├── pattern_tracker.py # cross-tick scouting memory
│ ├── overrides.py # 11 deterministic tactical rules
│ ├── fallback.py # per-position rule-based fallbacks
│ ├── parsing.py # parses LLM JSON (survives inline arithmetic)
│ ├── tuning.py / tuning.json # autopilot's control surface
│ └── match_analytics.py # heatmaps / match splitting / reports
├── observe_dashboard.py # dashboard (+ analytics / settings / i18n)
├── portal_bot.py # Playwright portal automation + LiveCoach
├── grind_matches.py # batch grinding
├── autopilot.py # the fully automated iteration loop
└── analyze_match.py # CLI reportOne design rule: position entry points stay thin; everything shared lives in
lib/ . All five positions run the same pipeline, so a fix lands once and applies to the whole team.One player = ~80 lines of main.py
FWD1 (left striker) as the example — the entry file only does four things: write the prompt, pick the fallback, pick the overrides, pick the model:
SYSTEM_PROMPT = f"""Ultra-aggressive left striker AI. You control ONLY player {MY_PLAYER_ID}
(FWD1) in 5v5 soccer. Each tick: read state, reply ONE command.
RULE #1 — SHOOT CENTER. Read TACTICS Shot line:
- "LANE CLEAR" / "POINT-BLANK" / "LANE BLOCKED": SHOOT CENTER power 1.0.
- Never dribble for a better angle inside 45m — shoot immediately.
...
Reply ONLY the JSON array, no other text:
[{{"commandType":"SHOOT","playerId":3,"parameters":{{"aim_location":"CENTER","power":1.0}},"duration":0}}]"""
# Rule fallback: only the designated player presses (no 5-man mobs)
AGG_FWD1_CONFIG = replace(FWD1_CONFIG, press_only_if_designated=True,
advance_y=-14.0, default_y=-14.0)
# Hard tactical rules: the prompt alone was ignored ~40% of the time
OVERRIDE_CONFIG = OverrideConfig(wing_y=-14.0)
# Nova 2 Lite: bake-off winner (100% JSON parse, tighter p95)
agent = create_agent(SYSTEM_PROMPT, model_id="us.amazon.nova-2-lite-v1:0")
create_invoke_handler(app, agent, MY_PLAYER_ID, POSITION_LABEL, fallback_commands,
fallback_cfg=AGG_FWD1_CONFIG, override_cfg=OVERRIDE_CONFIG)Two prompt tricks worth stealing: feed the LLM solved tactical conclusions (the
TACTICS Shot line is computed fresh every tick by tactics.py — the LLM only maps conclusions to an action), and end with one complete JSON example to anchor the output format.What happens inside one tick
- The Portal sends the full
gameStateto each agent
-
state.pycompresses it into a short state summary (and injects any liveCOACH ORDERon top)
-
pattern_tracker.pyappends a few scouting lines ("opponent #7 is the main threat, favors the left wing") — cross-tick memory without context growth
-
tactics.pyappends solved tactical math: shot probability, best pass, open space
- One Bedrock call (
temperature 0.2,max_tokens 200— the answer is a single JSON command, capping output bounds worst-case latency)
-
parse_commandsvalidates the JSON; on failure, the rule-based fallback answers instead
-
overrides.pyapplies 11 deterministic rules on top of whatever came out
- One structured DECISION line goes to CloudWatch; the command goes back to the game engine
Four degradation layers —
llm → parse-fallback → error-fallback → last-resort — mean the player never stands still. Memoryless agents also reset conversation history every tick: in a warm runtime, accumulated history inflates prefill latency on every call. Together with the token cap, decision latency dropped from ~1.5s to ~0.7s.The DECISION log: one JSON line powers everything
{"pos":"FWD1","tick":57,"t":93,"source":"llm","cmd":"SHOOT","latency_ms":612,
"hb":1,"dg":38.2,"mx":22.5,"my":-9.1,"hs":1,"as":1,
"want":"MOVE_TO","fix":1,"ov":"shot","aim":"CENTER","co":1}-
source— which layer decided (llm / parse-fallback / …) → the dashboard's "LLM share" and the 0%-LLM alert
-
hb/dg— had ball / distance to goal → shot discipline (real chances vs blind hoofs)
-
wantvscmd+fix— what the LLM wanted vs what ran;fix:1means an override corrected it
-
ov— which override fired → analytics override breakdown
-
mx/my— player coordinates → heatmaps
-
hs/as— live score → match reports, goal timeline, match splitting
-
co— a coach order reached the prompt → LiveCoach delivery proof
Define this schema first and the dashboard, heatmaps, autopilot KPIs, and AI advice all share one language — observability as a first-class citizen of the pipeline, not an afterthought.
overrides.py: prompts suggest, code enforces
This 40KB file was born from getting slapped by data. The module docstring preserves the evidence: in one match, 207 of 370 commands were MOVE_TO and 0 were MARK — despite the prompt explicitly ordering "MARK when a teammate presses". The LLM answered 100% of ticks, so any rule that lives only in the prompt is effectively optional. The match-deciding rules became deterministic code:
-
blast— GK/DEF possession → instant full-power shot at the emptiest part of the frame (clearance + shot in one)
-
build/launch/carry— with a clean lane, play the outlet pass / loft to the most advanced forward / carry up the wing (evidence: 92–98% of shots were 45m+ hoofs donating possession)
-
shot— MID/FWD in range with a clear lane must shoot; a shot at a covered corner is re-aimed at the open one
-
counter— 3+ opponents in our half → one THROUGH ball to the most advanced open forward
-
phantom— SHOOT/PASS without the ball wastes the tick → rewritten into a real defensive job
-
no-chase/anchor— non-designated players don't chase; defensive runs off the anchor line get clamped back
-
cutback/ carry cap — all shot lanes blocked → cut back to an open teammate (from 1-5 / 0-4 loss forensics)
-
tackle/gk-smother— the designated presser inside range slides; the GK smothers loose balls in our box
-
route-one— pressed with every ground outlet shut → loft it to the most advanced forward
Every trigger leaves an
ov tag in the DECISION log, and the analytics page counts them — whether a rule works is measured, not felt.tuning.json + autopilot: let the machine turn the knobs
Override thresholds shouldn't be hand-edited.
lib/tuning.json is a parameter overlay shipped with every deploy, and autopilot.py runs a closed loop around it:- MATCH — the Playwright bot plays one practice match
- OBSERVE — pull the match window's DECISION logs, distill KPIs (far-shot waste, possession height, siege indicators, override counts)
- TUNE — a bounded rule tuner adjusts
tuning.json(optionally an LLM advisor proposes the deltas)
- DEPLOY — redeploy the five agents
- RECORD — append everything to a history file; consecutive losses force exploration, wins freeze the config
The loop's first full run produced our first win, 3-2, against the aggressive bot.
LiveCoach: turning the coach into code
The
LiveCoach class subscribes to the live narration feed and maps situations onto the 6 preset shouts:if conceded: return ("conceded", "press_high") # win it back now
if scored and diff > 0: return ("scored", "slow_the_tempo") # keep the shape
if diff < 0 and late: return ("chase-late","go_all_out_attack") # nothing to lose
if diff < 0: return ("chase", "shoot_on_sight") # our identity
if diff > 0 and late: return ("protect", "slow_the_tempo") # hold the lineGoal-triggered orders are queued until the game clock resumes (otherwise the replay cutscene swallows them), with a 45s cooldown and same-situation dedupe. Orders are injected into every agent's prompt as a top-priority
COACH ORDER , and the DECISION co:1 field proves delivery. One shout steers five LLMs at once.
Install and usage
Commands verified on Windows PowerShell; on macOS/Linux replace
\.venv\Scripts\ with bin/ .Prerequisites: Python 3.10+, AWS credentials (workshop STS or long-lived), your workshop Team Code, and a deployed team (repo README sections 1–5).
1. Clone:
git clone -b football-workshop https://github.com/peterpanstechland/sample-ai-possibilities.git
cd sample-ai-possibilities/agentic-football-sample-agents2. Python environment:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements-observability.txt
python -m playwright install chromium3. AWS configuration:
copy .env.example .env
# Edit .env: Workshop STS credentials + AAFC_TEAM_CODE4. Start the dashboard:
$env:AWS_DEFAULT_REGION = "us-east-1"
.\.venv\Scripts\python.exe observe_dashboard.py --prefix agg_ --minutes 180 --port 8777Open the dashboard at localhost port 8777 —
/ is the decisions stream, /analytics the match analytics with heatmaps and AI advice, /settings for credentials and the CloudWatch download. On first use, click Download CloudWatch data once in Settings; every page then loads from the local cache.5. Grind matches (optional):
$env:AAFC_TEAM_CODE = "your team code"
.\.venv\Scripts\python.exe grind_matches.py --count 5Full reference: in the repo.
Where it started: AWS Summit Shanghai 2026
This was not my first encounter with Agentic Football Cup. At AWS Summit Shanghai 2026 I competed on-site via Harness — the official site captions that day as "120+ builders, one unforgettable match day".

Event photos: agenticfootballcup.com
That day I also had the pleasure of meeting the game's author:
If Shanghai was the demo, this 72-hour pre-test was writing the coach's handbook and toolchain for the Beijing UG Workshop.
Takeaways
- AgentCore end-to-end: Harness deploy → local agents → Runtime matches; one team = five independent agents
- Game mechanics: ~2s/tick, a compact command set, 900ms timeout budget, deterministic overrides, per-position models
- Observability: CloudWatch DECISION → local cache → dashboard (which caught a "0% LLM decisions" incident)
- Data-driven tuning: the heatmap exposed center-circle shooting; the latency scatter exposed slow positions; Bedrock wrote tuning advice
- Automation: 19 matches ground via Playwright plus an autopilot loop; live coach injection still experimental
- Community: a 72-hour pre-test and a live stream, paving the way for the Beijing workshop
We had a great time and genuinely learned AgentCore along the way. If you are joining an Agentic Football Cup workshop (signup at agenticfootballcup.com), take our github repo with you — issues and PRs welcome.
One last hope: may the Agentic Football Cup scene in China keep growing, and may Chinese builders fight all the way to the re:Invent 2026 finals and represent China in Las Vegas. Our men's national football team may keep letting us down, but we believe our agents can win without a sea-cucumber diet (a beloved running joke about the national squad's famously pampered nutrition). ⚽
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article