Skip to content

Validation errors leak absolute config file paths to user #987

@jariy17

Description

@jariy17

Summary

When Zod validation fails on agentcore.json, error messages include the absolute filesystem path to the config file. This leaks internal directory structure to the user.

Reproducer

agentcore add memory --name "bad name!" --expiry 30 --json

Actual behavior

{"success":false,"error":"/Users/username/path/to/project/agentcore/agentcore.json:\n  - memories[1].name: Must begin with a letter..."}

Expected behavior

{"success":false,"error":"agentcore.json:\n  - memories[1].name: Must begin with a letter..."}

Or just the error message without the file path.

Notes

Affects all add and remove commands that go through ConfigIO.writeProjectSpecvalidateAndWrite. The path comes from ConfigValidationError in config-io.ts.

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