We Had Hermes Write Its Own Stripe Skill With /learn. Then We Broke It on Purpose.
An agent that can write its own integration skill on demand sounds powerful right up until the skill it wrote turns out to hold a live credential with no guardrails around it. Here's what we found when we deliberately tried to break one.
Key takeaways
- -Letting an agent write its own integration on the fly is genuinely useful for coverage you didn't pre-build
- -The skill Hermes generated worked correctly on the happy path, which is exactly the risk
- -It had no retry safeguard, no scope limit, and no record of calls beyond what it chose to log itself
- -Breaking it on purpose surfaced a duplicate charge and a silent partial failure within minutes
- -Swytchcode lets the same self-written skill call a canonical tool instead of handling the credential itself
We told Hermes to use /learn to figure out how to issue a Stripe refund on its own, without a pre-built skill for it. Within a couple of minutes it had read the Stripe API docs, written a working integration, and successfully issued a test refund. It was genuinely impressive. It was also, by design, completely unsupervised, which is exactly why we spent the rest of the afternoon trying to break it.
What /learn actually does well
Give Hermes a task against a provider with no existing skill, and /learn has it read the provider's documentation, figure out the right endpoint and parameters, write the integration code, and test it against a sandbox. This closes the exact gap that a fixed catalog of pre-built skills can't: the provider nobody thought to pre-build support for yet. On the happy path, it worked correctly the first time.
Working correctly once is a low bar
A self-written skill passing its first test tells you it can call the right endpoint with the right shape of request. It tells you nothing about what happens when that call fails halfway through, gets retried, or gets asked to do something slightly outside what the original test covered. Nobody reviewed this code before it ran against a real account. The only thing standing between "it worked once" and "it's safe to leave running" was whatever safeguards Hermes happened to think to write in on its own.
What we found when we tried to break it
We simulated a network timeout right after a refund call actually went through on Stripe's end, then let the agent's own retry logic fire. The self-written skill had no idempotency key, so the retry created a second, duplicate refund. We then fed it a response with a 200 status but an error payload inside the body, a known Stripe pattern for certain edge cases, and the skill logged it as a success, because it was only checking the HTTP status code, not the body. Nothing about either failure showed up anywhere except in the raw API traffic, because the skill's own logging only recorded what it chose to record, which turned out to be a summary of what it believed happened, not a verified account of what Stripe actually did.
None of this was a flaw unique to Hermes
Every one of these gaps, missing idempotency, trusting a status code over the response body, logging only what the agent decided to log, is the same gap any hand-written skill has unless someone specifically built in the safeguard. An agent writing the integration on the fly doesn't introduce a new category of risk. It just removes the one moment, a human sitting down to write the code, where those safeguards might otherwise have gotten added out of habit.
How this looks with Swytchcode
The fix isn't telling Hermes to write more careful code every time it uses /learn. It's giving the self-written skill a canonical tool to call instead of a raw API client to construct. When the generated skill calls stripe.refund.create through swytchcode-operator rather than hand-rolling a direct call to Stripe's endpoint, the idempotency key, the response verification, and the audit record all come from the execution kernel, regardless of how carefully or carelessly the generated code around that call was written.
That means /learn keeps the part that makes it useful, an agent figuring out a new integration on demand, without that usefulness depending on the agent also happening to remember every production safeguard a careful human engineer would have built in by habit.
Related reading
- Retries, idempotency, and approval: the three things every AI agent workflow needs — the mechanics behind the idempotency gap this skill was missing
- Reward hacking is not just a training problem here is how to catch it in a live agent — why trusting the agent's own success report is exactly what went wrong with the 200-with-error-body case
Does this mean letting an agent write its own integrations is a bad idea
No, it's genuinely useful for exactly the coverage gap it closes. The point is that the usefulness and the safety are separate questions, and solving the first one doesn't automatically solve the second.
Would a human-written skill have had the same bugs
Quite possibly, especially from someone writing a quick integration under time pressure. The difference is that a human engineer reviewing their own code has at least one chance to catch it before it ships. An agent generating and immediately using the skill in the same session has no equivalent checkpoint unless one is built into the layer it calls through.
Did Hermes know its skill had these gaps
Not that it indicated. The generated code passed its own test and was treated as done. Nothing in the generation process asked it to specifically consider retry safety or response verification, so there was no reason for it to surface those as open questions.
More content
Reward hacking is not just a training problem here is how to catch it in a live agent
Reward hacking is usually described as a training-time research problem. In production it looks like an agent reporting a task done that it never did. Here is how to verify it.
Why scheduled AI agent jobs fail silently and how to fix it with outcome logs
A cron job that exits clean does not mean the task happened. Here is why execution logs lie and how outcome logs, idempotency keys, and verified exit codes fix it.
What Is Approval Laundering? How AI Agents Get Away With Actions You Never Approved
A human approves a description of what an agent intends to do. What actually executes can quietly be something else. Here is how approval laundering happens and how a Verifiable Action Card closes it.
