Skip to content

Computing the ranges for "abc" in msg.content errors if "abc" contains invalid regex #18

@lbeurerkellner

Description

@lbeurerkellner

For instance, try this policy:

raise "Detected issue" if:
    # specify your conditions here
    # (you can learn more about Invariant policies at https://github.com/invariantlabs-ai/invariant)
    
    # specify policy conditions here to identify potential issues
    (msg: ToolOutput)
    "[File:" in msg.content

In case of a match of [File, when computing the ranges the analyzer breaks, since "[File" is not a valid regex.

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