Expand description
Safety profiles — a cheap gate over the Discovery method surface.
One SafetyProfile answers “may this method run?” for both dispatch
surfaces: the CLI (grr api call and the generated tree, both gated by
the global flags on the root command in cli.rs) and the grr mcp
server. The check is a verb + service-name lookup per call — no I/O —
so it can sit on every request path.
grr api call gmail.users.messages.send --readonly # refused: POST
grr api call gmail.users.messages.list --deny-service chat # allowed
grr mcp --readonly # the server refuses writesStructs§
- Safety
Args - CLI flags for the gate, as a derive struct so
cli.rscan flatten it onto the root command without re-declaring the flags. The generated tree andgrr api callread them from the root matches (clap merges global args across levels). - Safety
Profile - The safety gate.
checkruns per method invocation ongrr api call,gen_dispatch::dispatch_with_profileand thegrr mcpserver — one verb + service lookup, never any I/O.
Functions§
- global_
args - The same three flags as
global(true)args, for attaching to the root command.