Hacker News new | ask | show | jobs
by radim_h 47 days ago
We’re building Stashbase.dev around this. The agent makes API calls through a proxy that holds the upstream credentials, with access restricted by host, method and path. Revoking the session cuts off further proxy access even if the agent is still running.

The awkward part is deciding how narrow to make those rules. An allowed endpoint can still do something you didn’t want. Are method/path restrictions enough for your use case?

1 comments

Method and path help, but they are not enough on their own.

The same POST /messages can mean "save a draft" or "send to the customer." The same invoice endpoint can list or charge. Host and method filters stop random hosts. They do not encode intent.

What I want on top is an effect class per call: read vs write vs irreversible. Irreversible stays human-gated or hits a hard deny. Everything else can keep a budget and an audit trail. Revoking the proxy session is good. Stopping a bad action that was still in policy is better.

With MCP we let you allow or deny individual tools, so separate draft/send tools work for this. But if it’s one tool with an action argument, we can’t distinguish them today.

Do you think it would make sense to add something like rules for JSON content for plain HTTP requests and argument rules for MCP tool calls?

Yes, I think that's the right next layer. On a lot of real APIs the risky part lives in the body, not the path. A messaging API where the same call drafts or sends. A payment call with a capture flag. A bulk update whose filter happens to match every record.

Two things I'd watch. First, default-deny on fields the rule doesn't know about, so a new argument can't slip through. Second, let rules check values, not just whether a field is present. Amount over a limit, recipient outside an allowlist, an empty filter. That's where most of the "in policy but still wrong" actions live.

For MCP I'd also let the tool author tag each action as read, write, or irreversible, and treat anything untagged as irreversible. Then argument rules are the override, not the only line of defense.

Hey, we’ve added HTTP body and MCP argument rules now, including value checks and an allow_fields list to reject unknown fields. Your feedback and input from others helped shape this!

Implementation and examples: https://github.com/stashbase/cli/releases/tag/v0.22.0

Nice, that was fast. Failing closed when the body isn't readable JSON is the part I'd have worried about most, and you covered it. Naming the field but not the value in the 403 is a good call too. The agent learns what to fix without the log leaking a recipient or an amount.

One thing I'd be curious about over time is GraphQL, since one endpoint can do everything. An exact-query allowlist is the safe default, but it'll get painful fast on big APIs. Thanks for following up.

Feel free to test it out!