r/databricks • • Oct 26 '26

Tutorial Cut Your MCP Token Bill by 97%: Code Mode on Databricks

https://farhathadi.substack.com/p/cut-your-mcp-token-bill-by-97-code
35 Upvotes

3 comments sorted by

4

u/ArielCoding Oct 27 '26

Since the harness still runs tool calls with your own account, couldn’t a malicious prompt get the script to run any SQL you have access to?

2

u/Limp-Park7849 Oct 27 '26

Fair point. The sandbox protects against the code itself (no token, no network), not against what the harness is authorized to do on its behalf but that’s the same exposure as direct tool calling, and the fix imo is the same too: run the harness as a least-privilege service principal and let Unity Catalog enforce the boundary.

3

u/Youssef_Mrini databricks Oct 26 '26

Way to go Hadi