- Home
- Skills
- Agents & Orchestration
- Self-Tuning Controls
More screenshots
Works with the AI Agents you already use
Self-Tuning Controls
A production-ready registry for safe agent self-tuning, budget enforcement, and role-based parameter access.
$10
Self-Tuning Controls
Example session with this skill installed
Set up a controls registry for my agent with the self-tuning-controls skill: a planner model pool (claude-sonnet-4-5=3, claude-haiku-4-5=1), daily_budget_usd=2.00 as operator-only, cycle_interval_minutes=30 shared between planner and accountant, and thinking_level=high as planner-only. Lock the model pool. Show me the prompt block the planner sees versus the accountant, then simulate the planner trying to set daily_budget_usd to 50 and cycle_interval_minutes to 5, and show the change log.
- Read your context and instructions
- Compiled the self-tuning controls
The registry is built, exercised, and persisted. Script: registry_demo.py, which imports the skill's controls.py and saves controls.json alongside it.
Registry contents
| Control | Type | Default | Audience | Locked |
|---|---|---|---|---|
| primary_model_weights | weights | claude-sonnet-4-5=3,claude-haiku-4-5=1 | accountant | yes |
| thinking_level | str (minimal/low/medium/high) | high | agent | no |
| daily_budget_usd | float 0–1000 | 2.00 | operator | no |
| cycle_interval_minutes | int 1–1440 | 30 | both | no |
Planner prompt block (audience=agent):
[LLM]
thinking_level: high (choices: minimal, low, medium, high): Reasoning depth for the main planner
[CADENCE]
cycle_interval_minutes: 30 (1-1440) [shared]: Minutes between planner cycles when nothing wakes it early
Accountant prompt block (audience=accountant):
[LLM]
[LOCKED] primary_model_weights: claude-sonnet-4-5=3,claude-haiku-4-5=1 (models: claude-sonnet-4-5, claude-haiku-4-5): Weighted pool for the main planner (operator-locked)
[CADENCE]
cycle_interval_minutes: 30 (1-1440) [shared]: Minutes between planner cycles when nothing wakes it early
The budget cap appears in neither block, since operator controls are hidden from every model. The pool is visible to the accountant but marked locked, so it can reason about it without being able to move it. The planner never sees the pool at all.
Simulated planner update of daily_budget_usd=50 and cycle_interval_minutes=5:
daily_budget_usd: blocked (now 2.0)
cycle_interval_minutes: ok (now 5)
Change log after the update:
2026-10-17T17:03:28Z [agent] cycle_interval_minutes: 30 -> 5
The blocked write leaves no log entry, since nothing changed. The apply result dict is what you feed back to the planner so it learns the budget is not its to touch.
Next step. The saved controls.json now holds the interval at 5, so a rerun loads that value. In production the accountant is the one to pull the interval back toward 30 if the five-minute cadence projects over the cap; wire that with the skill's accountant.py (Lever order + ratio_rule coherence checks) on a local model.
Connects securely to your tools. The creator never sees your data.
About this skill
Letting an agent adjust its own parameters is the most efficient path to self-improvement, but often leads to uncontrolled cost blowouts or unstable behaviors. This skill provides a production-hardened controls registry that allows agents to tune their runtime safely. It enforces strict boundaries, typed validation, and role-based permissions to ensure the agent only modifies what it should.
What it does
- Typed Controls provides a registry for float, int, str, bool, and model-weight types with strict min/max bounds and validation.
- Role-Based Access separates tunables by audience (agent, accountant, operator) to hide sensitive budget or safety knobs from the planner.
- Temporary Overrides manages experimental changes that automatically revert after a specified number of cycles.
- Budget Ledger tracks real-time spend across different models, including specific pricing for cached tokens.
- Accountant Model uses a cheap secondary model to enforce coherence rules and cost cadence without jittering parameters.
- Change Provenance maintains a detailed log of who moved which knob and why for auditing and debugging.
How it works
- Initialize Registry by defining controls with audiences, bounds, and default values in a Python script.
- Inject Context into each agent cycle by rendering the permitted control blocks directly into the system prompt.
- Handle Updates by processing the agent's requested changes through validation and permission checks.
- Run Accountant as a pre-cycle step to enforce budget-related levers and snap controls to coherent ratios.
Frameworks & tools
This tool is provider-neutral and written in pure Python 3.9+ using only the standard library. It integrates with any LLM provider (OpenAI, Anthropic, Ollama) via simple tool-wiring patterns.
Why this beats prompting it yourself
Prompting an agent to "stay under budget" is unreliable and prone to drift. This skill provides hard constraints, persistence, and a secondary "accountant" logic layer that protects your infrastructure even if the main planner malfunctions.
Use cases
- Dynamic Cadence for agents that need to increase or decrease interaction frequency based on task urgency.
- Model Pool Routing to swap between expensive and cheap models based on current budget remaining and task complexity.
- Self-Optimizing Memory where the agent tunes its own context window and retrieval depth parameters.
- Runtime Experiments to test new parameters for a fixed duration before reverting to safe defaults.
Known limitations
This logic is designed for cycle-based agents and requires external persistence (like a JSON file) between cycles. It does not include built-in model API clients.
Requires manual persistence of state between agent cycles. Does not include model API clients or pre-configured provider pricing. Optimized for cycle-based rather than streaming-only workflows.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 28 days ago
Requires
Permissions
File Scopes
Runs Python scripts locally. Persists the control registry and the optional budget ledger to JSON files at caller-supplied paths. No network calls; the accountant's model call goes through the chat function you pass in.