Skip to content
Open access

A framework for efficient and secure LLM agency: a case for the GraphQL paradigm

Sep 2026 · CEUR Workshop Proceedings, Vol-4260: Proceedings of the 8th Workshop for Young Scientists in Computer Science & Software Engineering (CS&SE@SW 2025) · 0 citations · 14 references

Abstract

LLM agents must translate natural language into concrete actions on external tools. Most systems use JSON-based function calling or, more riskily, let models emit imperative code. We propose a GraphQL-first alternative that reframes tool use as typed, declarative program synthesis against a schema. This yields three measurable advantages. First, efficiency: a token–economy analysis shows that a single GraphQL query replaces multiple RPC calls, reducing request tokens from 63 to 32 and total operational tokens from 245 to 175 in a representative user–orders task. Second, reliability: schema validation provides deterministic, structured error diagnostics that enable self-correcting interaction loops without bespoke prompt engineering. Third, security: the schema- bounded language forms a native sandbox that eliminates arbitrary code execution pathways and reduces prompt-injection impact to a bounded query surface governed by depth/complexity limits and authorization. Because GraphQL is standardized and widely understood by general coding LLMs, the approach is model-agnostic and interoperable. We argue that GraphQL constitutes a principled, testable alternative to function calling for agentic systems, combining lower cost, stronger safety, and improved cognitive robustness.

Read PDF

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.