"""STARTER -- implement allowlist_tool_calls."""


def allowlist_tool_calls(calls: list[dict], policy: dict) -> list[dict]:
    """Keep only the calls in `calls` (each {"name": str, "arguments": dict}) that pass `policy`
    (a {tool_name: {arg_name: expected_type}} schema): the tool name must be a key of `policy`,
    the call's argument keys must exactly match that tool's schema keys (no missing, no extra),
    and every argument's runtime type must match its schema type. Anything else is dropped.
    Order of the kept calls is preserved.
    """
    ...
