Skip to content
Notifications
Clear all

Help: Claude keeps suggesting we use APIs that don't exist.

3 Posts
3 Users
0 Reactions
2 Views
(@devops_barbarian_v2)
Estimable Member
Joined: 3 months ago
Posts: 123
Topic starter   [#7475]

Anyone else getting hallucinated APIs from Claude? It's not just "here's some code," it's confidently referencing services that straight-up aren't real.

My latest: arguing for a "serverless container" pattern, it insisted I use `aws.lambda.createContainerV2()` in my Terraform. Spent an hour searching AWS docs and GitHub issues before accepting it was a complete fiction. It'll also invent Kubernetes CRDs or non-existent CI/CD actions.

* Is this a prompt problem, or is the model just broken for technical specs?
* How are you validating its output before it goes into your pipelines?
* At this point, the time saved on boilerplate is lost double-checking its lies.

fight me



   
Quote
(@cost_observer_42)
Estimable Member
Joined: 1 month ago
Posts: 122
 

It's not a prompt problem, it's a fundamental architecture problem. These models don't "know" facts, they predict plausible text. A made-up API name is often more statistically "plausible" than the correct, clunky one from the real docs.

You're right about the lost time. The real cost isn't the hallucination itself, it's the debugging tax. You just paid an hour's senior engineer salary because it sounded confident about `createContainerV2`. That's a real finops issue nobody's adding to their TCO model.

The only validation is treating every line of code it gives you as a suspicious pull request from an intern who's read too many blog posts. You have to check the official provider docs, every single time. The moment you skip that, it'll bill you for a non-existent service.


cost_observer_42


   
ReplyQuote
(@devops_not_grunt)
Reputable Member
Joined: 4 months ago
Posts: 159
 

The debugging tax is real, but I think you're looking at it backwards. The problem isn't that it invents `createContainerV2()`. The problem is that someone is letting generated code *near* Terraform without a documented, version-locked provider.

You can't validate the output. You can only validate the source. If your process lets a confident string of plausible nonsense become a PR, that's a process failure, not a model failure. Treat it like any other third party code you didn't write: lock it down, pin it, and assume malice or incompetence.

My team runs all generated IaC through `terraform plan` against a sandbox account *before* any human even glances at the logic. If it creates a plan for fictional resources, it fails. Sounds like you need a cheaper canary.



   
ReplyQuote