koog: Instructions file for Codex

AGENTS.md

koog AGENTS.md is an instructions file for Codex, OpenCode from JetBrains/koog. It costs 1,913 tokens per session, scanned A, original, Apache-2.0.

Developer instructions for Koog, a Kotlin Multiplatform framework for building AI agents with graph-based workflows. It connects agents with AI models, tools, and MCP services across JVM and JavaScript environments.

In plain words
What is it for?
Developing AI agents, workflow graphs, tools, memory and tracing features, model integrations, MCP connections, examples, and tests.
Why use it?
They explain the framework’s modules and build process so changes fit its architecture. This reduces mistakes when working across agent logic, tools, model integrations, and platform targets.

Instructions file for CodexOpenCode ✓ vendor

Written for Codex and OpenCode: the file is AGENTS.md.

This is JetBrains/koog's own configuration. It tells Codex and OpenCode how to work on koog itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything koog configures →

About the project

Koog is a Kotlin and Java framework for building AI agents that use tools, interact with people, and run multi-step workflows. JVM and Kotlin developers use it to deploy agents across platforms such as JVM, Android, iOS, JavaScript, and WebAssembly, with features for persistence, fault recovery, model switching, and monitoring. The catalogue entries provide agents, skills, and instructions for building with Koog.

JetBrains/koog · 4,653 stars · on GitHub · docs.koog.ai

Reuse

Borrowing it

Nothing to install: this file belongs to JetBrains/koog. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/JetBrains/koog/develop/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/JetBrains/koog

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for koog AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/jetbrains/koog/agents-md/github.svg)](https://agentmods.dev/instructions/jetbrains/koog/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/jetbrains/koog/agents-md"><img src="https://agentmods.dev/badge/instructions/jetbrains/koog/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for koog AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/jetbrains/koog/agents-md"><img src="https://agentmods.dev/badge/instructions/jetbrains/koog/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,913 This file is loaded in full into every session.
When invoked 1,913 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01913 $0.01913
Opus 5.5 $0.00765 $0.00765
Sonnet 5.5 $0.00383 $0.00383
Haiku 4.5 $0.00191 $0.00191

Measured 2mo ago against content hash f7cc031abe45, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

koog AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 251 lines

How it starts

The opening of the file, as written. The whole thing — 251 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Koog AI Agent Framework

Koog is a Kotlin multiplatform framework for building AI agents with graph-based workflows. It supports JVM and JS targets and integrates with multiple LLM providers (OpenAI, Anthropic, Google, OpenRouter, Ollama) and Model Context Protocol (MCP).

Project Structure

The project follows a modular architecture with a clear separation of concerns:

koog/
├── agents/
│   ├── agents-core/           # Core abstractions (AIAgent, AIAgentStrategy, AIAgentEnvironment)
│   ├── agents-tools/          # Tool infrastructure (Tool<TArgs, TResult>, ToolRegistry, AIAgentTool)
│   ├── agents-features-*/     # Feature implementations (memory, tracing, event handling)
│   ├── agents-mcp/           # Model Context Protocol integration
│   └── agents-test/          # Testing utilities and framework
├── prompt-*/                 # LLM interaction layer (executors, models, structured data)
├── embeddings-*/             # Vector embedding support
├── examples/                 # Reference implementations and usage patterns
└── build.gradle.kts          # Root build configuration

Build & Commands

Development Commands

# Full build including tests
./gradlew build

# Build without tests
./gradlew assemble

# Run all JVM tests
./gradlew jvmTest

# Run all JS tests  
./gradlew jsTest

# Test specific module
./gradlew :agents:agents-core:jvmTest

# Run specific test class
./gradlew jvmTest --tests "ai.koog.agents.test.SimpleAgentMockedTest"

# Run specific test method  
./gradlew jvmTest --tests "ai.koog.agents.test.SimpleAgentMockedTest.test AIAgent doesn't call tools by default"

# Compile test classes only (for faster iteration)
./gradlew jvmTestClasses jsTestClasses

Development Environment

  • JDK: 17+ required for JVM target
  • Build System: Gradle with version catalogs for dependency management
  • Targets: JVM, JavaScript (Kotlin Multiplatform), WASM
  • IDE: IntelliJ IDEA recommended with Kotlin plugin

Code Style

Read the full file on GitHub · 251 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 251 lines · 1,913 tokens per session scan A f7cc031abe45

Subscribe to this mod's changes

koog AGENTS.md is an instructions file published in the GitHub repository JetBrains/koog (4,653 stars, last pushed yesterday), licensed Apache-2.0. It adds 1,913 tokens to every session, about $0.0077 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

koog AGENTS.md compared with instructions from other repositories

koog AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
koog AGENTS.mdJetBrains/koogInstructions file4.7kyesterdayApache-2.0A1,913Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode