Skip to content

ShellVerificationTool

This docs was updated at: 2026-03-21

com.paragon.harness.tools.ShellVerificationTool  ·  Class

Extends FunctionTool<ShellVerificationTool.TriggerRequest>


A FunctionTool that runs a fixed shell command and returns the result.

Security model: The command is fixed at construction time by the developer. The agent can only trigger execution — it cannot modify the command. This prevents prompt injection attacks.

Example: let the agent run the project's test suite:

ShellVerificationTool testTool = ShellVerificationTool.builder()
    .name("run_tests")
    .description("Run the project test suite and return results")
    .command("mvn", "test", "-q")
    .workingDir(Path.of("/my/project"))
    .timeoutSeconds(120)
    .build();
Agent agent = Agent.builder()
    .addTool(testTool)
    .build();

See Also

  • VerificationResult

Since: 1.0

Methods

runCommand

public @NonNull VerificationResult runCommand()

Runs the configured command and returns the result. Can also be called programmatically.

Returns

the verification result


builder

public static @NonNull Builder builder()

Returns a new builder.


name

public @NonNull Builder name(@NonNull String name)

Sets the tool name (as seen by the LLM).


description

public @NonNull Builder description(@NonNull String description)

Sets the tool description.


command

public @NonNull Builder command(@NonNull String... command)

Sets the command as a vararg of tokens (no shell expansion).


command

public @NonNull Builder command(@NonNull List<String> command)

Sets the command as a list.


workingDir

public @NonNull Builder workingDir(@NonNull Path workingDir)

Sets the working directory for the command.


timeoutSeconds

public @NonNull Builder timeoutSeconds(int timeoutSeconds)

Sets the command timeout in seconds (default: 60).


build

public @NonNull ShellVerificationTool build()

Builds the tool.