Urgent.News

What's breaking now, across thousands of outlets.

Tech

An MCP Tool Schema Is Not an Authorization Check: A Laravel Design Pattern

An MCP tool can be wonderfully easy to call. That is exactly why a write-capable tool deserves more scrutiny than a read-only one. Imagine an assistant with a refund_invoice tool. Its input schema says it accepts an invoice ID and a reason. The schema helps a client construct a call; it does not tell your server which person is allowed to refund which invoice . Those are separate decisions. The…

The MCP tool schema alone does not provide authorization checks. While it aids in constructing a call by specifying input parameters like an invoice ID and reason, it does not determine who is permitted to perform the action, such as refunding a particular invoice. The responsibility lies with the server to handle input validation, access controls, rate limiting, and output sanitization.

Additionally, the specification recommends confirming sensitive operations within the chat interface, but this confirmation should not replace server-side enforcement. A layered security approach is advised, involving authentication and throttling at the HTTP level, followed by server-side validation of the arguments. After validating the invoice details, the server must authorize the action on the specific record by consulting policies.

Laravel's gates and policies are designed for such decisions. The flow includes steps like authenticating the caller, validating the input, loading the invoice in the appropriate tenant scope, authorizing the refund action, checking for idempotency and current state, executing one mutation, and recording relevant details. Tools should be designed with a read-only preview_refund endpoint, followed by a commit_refund endpoint that rechecks authorization and state.

The response should contain only necessary information for the assistant, like the operation ID, status, and a safe summary. Avoid leaking sensitive data or implementation details. Before exposing a write tool, ensure no unauthenticated caller can reach the endpoint, all arguments are validated on the server, a policy checks the actor against the specific record, retries are safe and observable, and the output does not reveal sensitive data.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

A tiny Python helper for source-grounded content repurposing

A content-repurposing workflow has two different jobs: assembling a consistent draft pack, and deciding whether the draft actually says what the source supports. A script can help with the first job.

  • Python script simplifies content repurposing from articles or transcripts
  • Script performs draft creation and source verification, no API key needed
  • Manual review required to ensure factual accuracy and originality

openat2 Path Confinement Still Needs a Trusted Directory Descriptor

openat2 Path Confinement Still Needs a Trusted Directory Descriptor A service that accepts a user-supplied filename has two problems to solve.

  • openat2() call helps prevent path resolution outside intended directory
  • RESOLVEBENEATH option restricts pathnames to designated directory tree
  • Proper error handling crucial to identify policy issues and attacker-controlled input

Sentry Error Tracking: Catch Bugs Before Your Users Do

Quick answer Sentry error tracking collects the exceptions your Python app raises in production and groups them into issues you can triage, with the stack trace and how many users were hit.

  • Sentry captures Python exceptions in production
  • Reports stack trace and affected users
  • Integrates with Django, Flask, FastAPI

More from Saturday 14 November →