-
Notifications
You must be signed in to change notification settings - Fork 312
Consider restricting maximum input lengths #73
Copy link
Copy link
Open
Labels
i18n-trackerGroup bringing to attention of Internationalization, or tracked by i18n but not needing response.Group bringing to attention of Internationalization, or tracked by i18n but not needing response.security-trackerGroup bringing to attention of security, or tracked by the security Group but not needing response.Group bringing to attention of security, or tracked by the security Group but not needing response.
Description
Activity
Metadata
Metadata
Assignees
Labels
i18n-trackerGroup bringing to attention of Internationalization, or tracked by i18n but not needing response.Group bringing to attention of Internationalization, or tracked by i18n but not needing response.security-trackerGroup bringing to attention of security, or tracked by the security Group but not needing response.Group bringing to attention of security, or tracked by the security Group but not needing response.
We have generally made the observation that shortening any web-exposed text consumed by an agent reduces an attacker's ability to run prompt injection attacks (or, phrased differently, dramatically shrinks the total universe of injections available to an attacker). This doesn't fully solve for prompt injection but complements other means of defense such as classifiers or supervisor / critic models.
Anecdotally, there is also a cutoff at which long elaborate prompts tend to confuse models more than help them from a quality perspective, and the added instruction set of many available tools could contribute to a bloated model context.
I'm not sure if there's any published research on this yet, at least I haven't read any, and this is based on practical red teaming experience. Nonetheless, we should consider this at the design phase for WebMCP, since it would be very hard to implement such a restriction retroactively (and if research would disprove my experience, extending the maximum length is trivial).
Can we find some conservative maximum character length for all developer-provided inputs such as tool name, description, property names / descriptions, etc.?
cc @victorhuangwq @khushalsagar