Skip to content

Consider restricting maximum input lengths #73

@johannhof

Description

@johannhof

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions