Can an AI model execute Bitcoin wallet functions directly?
No. In a function-calling design, the model proposes a named function and arguments; the trusted Go application decides whether to execute it.
The engineering pattern
The application validates the JSON, authenticates the caller, checks permissions, and calls the existing Bitcoin Engine.
Security and product boundaries
The model must never receive BTC KEY or an unrestricted shell tool.
Practical validation
Reject unsupported function names and unauthorized SEND requests.
Why this matters for developers
A wallet tool should expose a predictable capability with explicit inputs, bounded outputs, and a clear failure mode. A model's ability to choose a tool does not confer permission to use that tool. Developers can reuse the approach for self-hosted applications without changing the tested Bitcoin Engine or its immutable per-wallet signed fee law.
Related reading
Why is strict JSON Schema not enough to secure Bitcoin payments?
https://thamer.org/ask/why-strict-json-schema-not-enough-bitcoin
Should a Bitcoin AI agent have an execute_shell tool?
https://thamer.org/ask/should-bitcoin-ai-agent-have-execute-shell
Go Function Calling for WALLET AI BITCOIN: The Deterministic Executor
https://thamer.org/learn/go-function-calling-wallet-ai-bitcoin-executor
Primary technical references
OpenAI function calling documentation:
https://platform.openai.com/docs/guides/function-calling
Go net/http documentation:
https://pkg.go.dev/net/http
OWASP AI Agent Security Cheat Sheet:
https://cheatsheetseries.owasp.org/cheatsheets/AI_Agent_Security_Cheat_Sheet.html
Model Context Protocol tools specification:
https://modelcontextprotocol.io/specification/2025-06-18/server/tools
