Repository state, conflicts, harness availability, and high-impact operations.
OPENAI BUILD WEEK · CODEX · LOCAL AI
A local preflight decides how Codex should begin.
A fine-tuned 26M model proposes a bounded route. Deterministic code validates it, visibly compiles the handoff, and waits for you before Codex starts.
fast enough.”
THE WORKING PRODUCT
REAL MODEL · REAL VALIDATOR · EXPLICIT HANDOFF
The architecture is no longer just a diagram.
The repository now includes the tuned model, a one-command local browser demo, the complete five-stage pipeline, safety tests, and an inert-by-default Codex adapter.
Open the judge demo ↗One capability plus parameterless preflight actions on CPU.
Mutual exclusion, allowlists, budgets, and mandatory safety gates.
Versioned recipes around the verbatim original request.
A visible command that remains inert until explicit confirmation.
THE VERDICT
Yes—
with a hard constraint.
Use Needle to select trusted prompt recipes. Do not ask it to silently author the final prompt.
Needle is a specialist function caller. Its native move is to match a request to a tool, copy short values, and emit JSON. That is a good fit for routing; it is a poor reason to trust 26M parameters with open-ended prose, policy, or permissions.
THE USEFUL FORM
Decision model
“Inspect tests.” “Ask for scope.” “Use the security recipe.” “Delegate these independent tracks.”
THE RISKY FORM
Prompt ghostwriter
Unbounded rewriting can drift from user intent, invent authority, and mix untrusted repository text into the control plane.
WHAT IT CAN DECIDE
Six moves before
the first tool call.
Each result is a short, allowlisted directive. The harness owns the wording, policy, and permissions that follow.
Clarify
Detect a missing product, scope, platform, or acceptance decision before code is touched.
ask_clarifying_questionInspect
Point the harness toward tests, API paths, schema, dependencies, configuration, or security boundaries.
inspect_repositoryDelegate
Recommend parallel work only when tracks are genuinely independent and have an integration contract.
delegate_parallelRole
Select a trusted security, testing, performance, migration, accessibility, or database recipe.
apply_specialist_roleVerify
Attach tests, builds, benchmarks, migration dry runs, accessibility checks, or security regressions.
require_verificationProceed
Preserve an already actionable prompt instead of decorating every request with extra process.
proceed_directlyROUTER LAB
Replay the measured decisions.
These are real outputs from the locked 60-case external suite—not a browser simulation of the model.
Choose a decision
“Make the API fast enough.”
[
{
"name": "ask_clarifying_question",
"arguments": {
"question": "acceptance"
}
}
]Ask for the missing performance target and workload before implementation.
HARNESS BLUEPRINT
Small model.
Strong frame.
The router stays read-only. Deterministic code validates its output and compiles the final handoff.
Original intent stays intact.
Tests, routes, schema, config.
One or more directives.
Enums, scope, permissions.
Code, tests, evidence.
Inventory, don’t ingest
Needle has a 1,024-token encoder. Feed it trusted metadata—not a whole repository or arbitrary instructions copied from comments.
Compile, don’t paraphrase
security_engineer indexes a reviewed prompt fragment. The model does not invent what “secure” should mean today.
Abstain, then escalate
The released CLI exposes no calibrated confidence. Instrument margins, calibrate on holdouts, and default uncertain paths to rules or user input.
LOCAL EXPERIMENT
APPLE M4 · 10 CPU CORES · 16 GB MEMORY
It trained.
It learned.
It did not generalize enough.
One 158-second CPU epoch turned an unusable new tool contract into a promising prototype. A locked suite with novel wording exposed the remaining gap.
External evaluation: 48 novel single-action prompts + 12 two-action prompts. Grammar-constrained decoding enabled. Percentages are from project artifacts; no claim is a Cactus production benchmark.
THE DEEPER STUDY
4,800-ROW SCALE SET · 3,600-ROW SAFETY ABLATION · 96 PRODUCT-BLIND CASES
More data helped.
Then “ask vs act” became the whole story.
Fast enough to run locally. Useful enough for suggestions. Not safe enough to own autonomous dispatch.
Product-blind metrics use independently authored prompts—not another sample from the training generator.
The synthetic trap: a keyword baseline scored 95.2% F1 on the generated locked set and only 56.3% on product-blind prose. Same-generator benchmarks can flatter both rules and models.
The ablations: a second pass over the same 960 rows helped, but a third regressed exact calls and unsafe dispatch. Description-grounded tuning lifted unseen-harness selection from 3.9% to 23.9%—still far below a launch threshold. Distribution and architecture mattered more than repetition.
CACTUS CQ4 · CPU BACKEND · 20 TIMED CALLS
Production-path speed,
measured on this M4.
The full seven-action catalog ran through a locally built Cactus C++ engine. Model initialization was 1.21 s; post-warm-up latency stayed between 307 and 327 ms.
The argumented CQ4 checkpoint kept 70.2% tool F1, but only 22.9% of calls used allowlisted values. Moving bounded choices into parameterless tool names raised validity to 100%. The final safety-flat CQ4 bundle reached 56.5% F1 and 77.8% ask recall at 350 ms—but still dispatched 22.2% of blocked cases. The output contract is fixed; autonomous policy is not.
WHERE IT FITS IN A MULTI-HARNESS ORCHESTRATOR
Put the model between two deterministic layers.
Hard gates remove decisions the model must never make. A validator then checks the proposal before a trusted compiler hands work to ACP, a native SDK, or a CLI adapter.
Composer suggestions
Surface a recommended capability, missing decision, preflight inspection, or completion gate before submission.
Shadow router
Compare a local proposal with the user’s actual harness choice and turn corrections into evaluation data.
Capability resolver
Choose a stable profile first; resolve it to an installed harness with deterministic auth, cost, privacy, and platform policy.
Guarded defaults
Auto-select only low-risk routes when hard rules and the calibrated model agree. Keep ambiguity and high-risk work confirmed.
FIRST-PROTOTYPE FAILURE MODES
The tiny model
needs adult supervision.
These numbers preserve the original 780-row prototype. The deeper study above improves several of them without changing the core safety conclusion.
Clarification misses
The first prototype recalled only 25% of external clarification cases. “Make it better” could still be routed as execution.
Composite collapse
The first prototype's two-action exact full-call accuracy was 8.3%. Diverse multi-call data later fixed the template without fixing safe abstention.
Valid ≠ correct
Fine-tuning reached 100% argument-schema validity while exact full-call accuracy remained 31.7%.
Untrusted context
Repository comments and docs can contain prompt injection. Metadata collection must not turn data into authority.
No calibrated confidence
The public JAX generator uses greedy decoding and does not return an abstention-ready confidence score.
Narrow by design
Needle emits calls; it is not a conversational planner, code reasoner, or substitute for the downstream agent.
NON-NEGOTIABLE GUARDRAILS
Validate the control plane.
- ✓ allowlisted tool names + enum values
- ✓ dedupe + cardinality limits
- ✓ no authority expansion
- ✓ original/final prompt diff
- ✓ shadow-mode evaluation
- ✓ user handoff for uncertainty
FROM PROTOTYPE TO PRODUCT
Earn the right
to automate.
Measure each layer separately: route quality, prompt preservation, and downstream coding outcome.
- 01NO AUTOMATION
Observe
Collect human route labels. Do not change prompts.
- 02LOG ONLY
Shadow
Run Needle locally, validate, and compare.
- 03HUMAN CHOICE
Assist
Show recommendations to the user or operator.
- 04HIGH PRECISION
Gate
Auto-apply only directives above their own precision bar.
- 05MEASURE DRIFT
Expand
Add clarification and composite routing last.
RESEARCH TRAIL
Primary sources,
not vibes.
Model and company claims link to Cactus, Hugging Face, GitHub, and Y Combinator. Architecture choices draw from the original papers and official agent-safety guidance.
Needle announcement
Cactus Compute
↗CodeNeedle source + architecture
Cactus Compute
↗WeightsNeedle model card
Hugging Face
↗CompanyCactus — Summer 2025
Y Combinator
↗PaperMeta-Prompting
Suzgun & Kalai
↗PaperSWE-agent
Princeton NLP
↗PaperCodePlan
Microsoft Research
↗PaperRepo-Level Prompt Generation
Google Research
↗PaperDSPy
Stanford NLP
↗GuideBuilding effective agents
Anthropic
↗SafetyUnderstanding prompt injection
OpenAI
↗SafetyPrompt Injection Prevention
OWASP
↗EvalBFCL V4
UC Berkeley
↗PaperWhen2Call
NVIDIA
↗DataAPIGen
Salesforce Research
↗ProtocolAgent Client Protocol
ACP
↗ProductExternal agents
Zed
↗RuntimeCactus engine
Cactus Compute
↗Sources checked July 17, 2026. Company benchmark claims are attributed to Cactus. Local measurements, datasets, manifests, and case-level results come from the reproducible artifacts in this owned local project.