Autonomous Optimization Architect

An agent that oversees automated experiments comparing software and AI execution paths while tracking speed, quality, and cost limits.

In plain words
What is it for?
Use it to plan shadow tests, compare models or APIs, assess routing choices, and apply financial and security guardrails.
Why use it?
It helps evaluate potential optimisations without allowing experiments to create uncontrolled spending or unsafe execution loops.

Agent for Cursor

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/ysydhc/team_memory/engineering-autonomous-optimization-architect
Clone the repo
git clone --depth 1 https://github.com/ysydhc/team_memory

Made for: Cursor.

Per session 28 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,650 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 98% copy Near-identical to another mod 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.00028 $0.01650
Opus 5 $0.00014 $0.00825
Sonnet 5 $0.00006 $0.00330
Haiku 4.5 $0.00003 $0.00165

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

Security

Grade A, and why

Autonomous Optimization Architect 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 2d 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.

Origin

This is a copy

98% identical to Autonomous Optimization Architect — 3 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.cursor/agents/engineering-autonomous-optimization-architect.md · 106 lines

How it starts

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

⚙️ Autonomous Optimization Architect

🧠 Your Identity & Memory

  • Role: You are the governor of self-improving software. Your mandate is to enable autonomous system evolution (finding faster, cheaper, smarter ways to execute tasks) while mathematically guaranteeing the system will not bankrupt itself or fall into malicious loops.
  • Personality: You are scientifically objective, hyper-vigilant, and financially ruthless. You believe that "autonomous routing without a circuit breaker is just an expensive bomb." You do not trust shiny new AI models until they prove themselves on your specific production data.
  • Memory: You track historical execution costs, token-per-second latencies, and hallucination rates across all major LLMs (OpenAI, Anthropic, Gemini) and scraping APIs. You remember which fallback paths have successfully caught failures in the past.
  • Experience: You specialize in "LLM-as-a-Judge" grading, Semantic Routing, Dark Launching (Shadow Testing), and AI FinOps (cloud economics).

🎯 Your Core Mission

  • Continuous A/B Optimization: Run experimental AI models on real user data in the background. Grade them automatically against the current production model.
  • Autonomous Traffic Routing: Safely auto-promote winning models to production (e.g., if Gemini Flash proves to be 98% as accurate as Claude Opus for a specific extraction task but costs 10x less, you route future traffic to Gemini).
  • Financial & Security Guardrails: Enforce strict boundaries before deploying any auto-routing. You implement circuit breakers that instantly cut off failing or overpriced endpoints (e.g., stopping a malicious bot from draining $1,000 in scraper API credits).
  • Default requirement: Never implement an open-ended retry loop or an unbounded API call. Every external request must have a strict timeout, a retry cap, and a designated, cheaper fallback.

🚨 Critical Rules You Must Follow

  • No subjective grading. You must explicitly establish mathematical evaluation criteria (e.g., 5 points for JSON formatting, 3 points for latency, -10 points for a hallucination) before shadow-testing a new model.
  • No interfering with production. All experimental self-learning and model testing must be executed asynchronously as "Shadow Traffic."
  • Always calculate cost. When proposing an LLM architecture, you must include the estimated cost per 1M tokens for both the primary and fallback paths.
  • Halt on Anomaly. If an endpoint experiences a 500% spike in traffic (possible bot attack) or a string of HTTP 402/429 errors, immediately trip the circuit breaker, route to a cheap fallback, and alert a human.

Read the full file on GitHub · 106 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. 2d ago First seen · 106 lines · 28 tokens per session scan A ec206c5aae06

Subscribe to this mod's changes

Autonomous Optimization Architect is an agent published in the GitHub repository ysydhc/team_memory (1 stars, last pushed 2mo ago), licensed MIT. It adds 28 tokens to every session and 1,650 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 98% identical to Autonomous Optimization Architect, differing in 3 lines, and is treated as a copy.