Skip to content

Agent2Game

An open protocol that lets existing games ask an AI model what their characters should do next — while the game stays in charge of what actually happens.

Don't want to read? Hand it to your agent.

Paste this into Claude Code, Codex, Cursor or any coding agent.

Read https://agent2game.org/llms-full.txt — the complete Agent2Game (A2G) protocol documentation. Then help me integrate A2G into my game: inspect my project, propose a manifest (world, entity types, observation fields, actions), write the adapter (observe, legal_actions, execute) and hook my entities so the game's original AI stays the fallback. Ask before changing existing game logic.
Game
Your game
Entities, rules, physics, native AI (FSM)
you write
Adapter + manifest
observe · legal_actions · execute
A2G provides
Engine SDK
Session, batching, epochs, TTL, reports, telemetry
proposed
Local policy
Small model trained on the service's decisions; runs offline
Decision service
A2G provides
Reference service
  • Validates against the manifest
  • Keeps per-entity memory
  • Holds provider keys
  • Debug console
Model
Model provider
Picks one action from the offered list.
Reference: OpenAI Decisions
  1. Describe the game once. A manifest lists the world, entity types, what each entity observes and which actions exist.
  2. Ask for decisions. The game sends observations for a batch of entities and the actions legal right now. The service asks a model to pick one per entity.
  3. Validate and execute. The game checks each choice and performs it through its own code — or runs its native AI if there is no valid, fresh decision.
  4. Report back. The game reports how each decision ended, which becomes the entity’s memory for its next decision.
  5. Learn and ship (proposed). Decisions from playtests train a small local policy. The shipped game runs it offline — no service, no per-decision cost.

Game AI is usually a hand-written state machine baked into each game. A2G turns plugging a model into that loop into a small, repeatable contract instead of a rewrite.

Game stays authoritative

Movement, physics, damage and rules stay in the game. The model only picks from actions the game offered.

Fallback by default

The game’s original AI is the default. Timeouts, invalid replies and stale decisions return control to it.

Game-agnostic

The service knows a game only through its manifest. No game logic lives on the AI side.

Observable

Chosen action, executed state and outcome are reported separately, so you can see what really happened.

Any decision model

OpenAI Decisions, TypeSafe Jev, a general LLM or a local model — swapped in the service, not in the game.

Ship without the cloud

Proposed: train a small local policy on the model’s decisions during development and ship the game with it.

Introduction

Protocol, SDK, adapter and service — what each part is. Read →

Integrate a game

Manifest, adapter and three hooks. Read →

Specification

Manifest, session, decide, report, telemetry and fallback. Read →

Example

A Godot 4 RPG with AI-driven enemies, end to end. Read →