image_generation

image_generation is an agent for coding agents from the-teacher/active_harness. It costs 0 tokens per session (1,219 once invoked), scanned A, original, MIT.

A Ruby agent setup that can send prompts to image-generation models and return an image as base64 data or a web URL. It supports a primary model and fallback model, with optional shared style instructions.

In plain words
What is it for?
Use it to generate images from text prompts, set image dimensions, apply a general style to requests, and choose backup image providers.
Why use it?
It lets an agent create images directly without adding a separate language-model backend. It also defines what happens when the preferred image service cannot be used.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/the-teacher/active_harness/image_generation
Clone the repo
git clone --depth 1 https://github.com/the-teacher/active_harness

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 image_generation

README.md
[![agentmods](https://agentmods.dev/badge/agents/the-teacher/active_harness/image_generation.svg)](https://agentmods.dev/agents/the-teacher/active_harness/image_generation)
Your own site
<a href="https://agentmods.dev/agents/the-teacher/active_harness/image_generation"><img src="https://agentmods.dev/badge/agents/the-teacher/active_harness/image_generation.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,219 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.01219
Opus 5 $0.00000 $0.00609
Sonnet 5 $0.00000 $0.00244
Haiku 4.5 $0.00000 $0.00122

Measured 4d ago against content hash 4802b87d7618, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

image_generation 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 4d 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.

docs/agents/image_generation.md · 99 lines

How it starts

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

Image Generation Agents

ActiveHarness agents can generate images natively — no custom_llm_backend/RubyLLM required. Enable it with image true and use the same model/fallback DSL as any other agent.

class ImageAgent < ActiveHarness::Agent
  image true
  size  "1024x1024"

  model do
    use      provider: :openrouter, model: "openai/gpt-5-image-mini"
    fallback provider: :openai,     model: "gpt-image-1"
  end
end
result = ImageAgent.call(input: "A watercolor fox in a snowy forest")

result.output      # => base64 string, "data:image/png;base64,..." or an HTTPS URL (provider-dependent)
result.processed   # => same as output (default format is :text)

Image APIs take a single prompt string — there's no separate system/user message split like in chat. So if the agent declares a system_prompt, it's prepended to @input (joined by a blank line) to form the final prompt; without one, @input is sent as-is.

class ImageAgent < ActiveHarness::Agent
  image true

  # Base style guidance — applies to every request.
  system_prompt "Watercolor style, soft pastel colors, no text overlays."

  model do
    use provider: :openrouter, model: "openai/gpt-5-image-mini"
  end
end

ImageAgent.call(input: "A fox sitting in a snowy forest")
# final prompt sent to the provider:
#   "Watercolor style, soft pastel colors, no text overlays.
#
#   A fox sitting in a snowy forest"

system_prompt accepts a plain string, a Prompt class, or a lambda — same as text agents (see Prompts) — so the base style can itself be dynamic (e.g. built from @context/@params).

Supported Providers

Only two providers currently support image generation:

Provider Class Example models
:openai Providers::Images::OpenAI "dall-e-2", "dall-e-3", "gpt-image-1"
:openrouter Providers::Images::OpenRouter any image-capable OpenRouter model, e.g. "openai/gpt-5-image-mini", "google/gemini-2.5-flash-image"

Read the full file on GitHub · 99 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. 4d ago First seen · 99 lines · 0 tokens per session scan A 4802b87d7618

Subscribe to this mod's changes

image_generation is an agent published in the GitHub repository the-teacher/active_harness (89 stars, last pushed 25d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,219 tokens. 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

Other agents, from other repositories

pixel-art-animation-reviewer

Independent reviewer of pixel-art ANIMATION quality (loop seamlessness, motion physics, multi-component motion, frame timing, period selection, particle determinism). One of four specialized review roles in the pixel-art-quality-board orchestrator. Use when the user asks to "check animation timing", "verify loop…

AnastasiyaW/codex-claude-code-config · 140 tokens

AGENTS.motiscope

Agent "AGENTS.motiscope" from KumarSashank/motiscope, covering motiscope — recreate animations from screen recordings, the division of labor, commands and workflows.

KumarSashank/motiscope · 0 tokens

trailer-curator

Analyze a full screenplay and curate a shot list for teaser/theatrical trailers. Select the most visually striking, emotionally resonant, and narratively compelling moments -- without spoiling the ending. Build a trailer that makes people want to watch the full film.

jordanurbs/venice-video-harness · 0 tokens

proposal-writer

Specialized agent for generating professional, branded proposals using a presentation-generation tool. Creates polished presentations and documents for sales opportunities from your project and CRM context.

Zeekeey-jpeg/LeRoy-HQ · 34 tokens

desktop-audio

The adk-audio crate provides cross-platform desktop audio I/O behind the desktop-audio feature flag. Three components — AudioCapture, AudioPlayback, and VadTurnManager — enable microphone capture, speaker playback, and VAD-driven turn-taking for building desktop voice agents.

zavora-ai/adk-rust · 0 tokens

vision

Analyze images with task-aware visual reasoning.

creativedswork/dscode · 9 tokens