AsAsked● guard v0.1.10 · benchmark runs 31 Oct – 5 Nov 2026 · 6 agents
Install
Add the guard to your agent
Before your agent pays, AsAsked checks the cart against what the person asked for. In apps like Claude Code or Cursor it runs as an MCP server; in your own code it sits in front of checkout. Pick your app below.
The guard reads the person's request with a language model, then compares it with the cart in plain code. It needs one key, as an environment variable or in the app's config. Without a key it cannot read the request, and every check answers ask.
The configs below use Claude. For Gemini, drop ,anthropic and set LLM_API_KEY instead of CLAUDE_API_KEY. A key written into a config file is stored there in plain text.
The MCP configs start the server with uvx, which downloads and runs the package itself, so there is nothing to install first. It comes with uv. No uv? See “Other MCP apps”.
Run once in a terminal, with your key in place of your-key:
Quit Claude Desktop completely and start it again. If the server does not appear, replace "uvx" with the full path that which uvx prints; on macOS the log is in ~/Library/Logs/Claude/mcp-server-asasked.log.
~/.cursor/mcp.json for every project, or .cursor/mcp.json in one. The key is read from your environment:
Restart Cursor after saving. If the server does not appear, the app may not see uvx: replace "uvx" with the full path that which uvx prints.
For Copilot agent mode: .vscode/mcp.json in a project. The key is read from your environment: a server that prompts for it (${input:...}) is not passed on to Copilot agent sessions.
Without uv, install the server with pip and use the path the second command prints as the command, with no arguments:
terminal
pip install "asasked[mcp,anthropic]"
which asasked-mcp # Windows: where asasked-mcp
If payment goes through your own code, put the guard there. The agent then cannot pay around it, and it cannot answer the question for the person.
terminal
pip install "asasked[anthropic]"
python
from asasked import Guard
guard = Guard("Black ASICS in size 42, I need to be able to return them.")
# checkout is your payment function; cart turns its arguments
# into a list of dicts (name, brand, color, size, price, returnable, ...)
pay = guard.protect(checkout, cart=lambda items: items)
# Give the agent pay instead of checkout. If the cart does not match the
# request, checkout is not called: the agent gets "NOT PAID" and a question
# to show the person. Their reply comes from your code, not the agent:
guard.answer("Yes, final sale is fine")
Agent frameworks get a ready hook over the same check:
framework
install
hook
Claude Agent SDK
asasked[claude-agent]
hooks={"PreToolUse": [checkout_hook(guard, cart, tool="mcp__shop__checkout")]} from asasked.integrations.claude_agent
OpenAI Agents SDK
asasked[openai-agents]
@function_tool(tool_input_guardrails=[checkout_guardrail(guard, cart)]) from asasked.integrations.openai_agents
LangChain 1.x
asasked[langchain]
create_agent(..., middleware=[CheckoutGuard(guard, cart)]) from asasked.integrations.langchain
The cart format and everything else Guard takes are in the docs.
I asked for black sneakers in size 42. The cart has white sneakers in size 42 for $50. Check the order with check_order.
It should come back with ask and a question about the colour. If it answers ask with “I couldn't automatically check this order”, the server runs but has no working key.
An MCP server answers only when the agent calls it, and it has to take the agent's word for the request and the person's replies. It helps an agent that wants to get the order right; it cannot stop one that skips it. To make sure nothing is paid around the guard, put it in front of your checkout, as in “Your Python agent”.