Skip to content

Conversation

@karanjitsingh
Copy link
Contributor

Issue #, if available: #92

Description of changes:
Introduces --read-only flag as a security guardrail. currently fix_access_denied is the only tool that mutates policies in customer's account, we should simply disable this tool if read-only flag is set, since generate_policy_for_access_denied already exists, no need for custom logic within fix_access_denied

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

let tools: Vec<Tool> = if self.read_only {
all_tools
.into_iter()
.filter(|tool| tool.name.as_ref() != "fix_access_denied")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of filtering by name, would it make sense for the tools to have a property against we filter?

}

pub async fn start_mcp_server(transport: McpTransport, port: u16) -> Result<()> {
pub async fn start_mcp_server(transport: McpTransport, port: u16, read_only: bool) -> Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of passing individual booleans, let's introduce a configuration object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants