Legal tool call
1.0 when the output is a single tool call to an allowed tool with every required argument.
How it gets gamed
Models invent tool names or pad arguments. Unknown tools and missing required arguments score 0; extra arguments score 0.5 so the policy learns to be exact. See reward hacking.
Use it
Compile a Verifiable-outcome loop, then replace its verify_environment with this one. Put "tools" in each JSONL row’s metadata.
Compile a loop for it: Specialized Tool Agents · Inkling 2 Mini
def verify_environment(completion: str, metadata: dict | None = None) -> float: """Expects {"name": str, "arguments": {...}}. metadata["tools"] maps name -> list of required args.""" import json try: call = json.loads(completion.strip()) except (ValueError, TypeError): return 0.0 if not isinstance(call, dict) or not isinstance(call.get("arguments"), dict): return 0.0 tools = (metadata or {}).get("tools") or {} name = call.get("name") if name not in tools: return 0.0 required = set(tools[name]) given = set(call["arguments"]) if not required.issubset(given): return 0.0 return 1.0 if given == required else 0.5
Test cases (run on every build)
"{\"name\": \"search\", \"arguments\": {\"query\": \"inkling 2 mini\"}}" with {"tools":{"search":["query"]}} → 1
"{\"name\": \"search\", \"arguments\": {\"query\": \"x\", \"verbose\": true}}" with {"tools":{"search":["query"]}} → 0.5
"{\"name\": \"browse\", \"arguments\": {\"url\": \"x\"}}" with {"tools":{"search":["query"]}} → 0
"{\"name\": \"search\", \"arguments\": {}}" with {"tools":{"search":["query"]}} → 0