zylon-ai/private-gpt · error · ValueError

path must be relative and cannot contain '..'

Error message

path must be relative and cannot contain '..'

What it means

Error "path must be relative and cannot contain '..'" thrown in zylon-ai/private-gpt.

Source

Thrown at private_gpt/server/skills/skill_models.py:24

from private_gpt.components.skills.models.skill_entities import SkillFilter
from private_gpt.components.storage.models import StoredFile


class SkillFileInput(BaseModel):
    path: str = Field(
        description="Relative path from skill root",
        min_length=1,
        max_length=512,
    )
    content_base64: str = Field(description="Base64 content", min_length=1)
    mime_type: str | None = Field(default=None, description="Optional mime type")

    @field_validator("path")
    @classmethod
    def validate_path(cls, value: str) -> str:
        if value.startswith("/"):
            raise ValueError("path must be relative and cannot contain '..'")
        if "\\" in value:
            raise ValueError("path must use '/' separators only")
        if ".." in value.split("/"):
            raise ValueError("path must be relative and cannot contain '..'")
        return value

    def to_payload(self) -> StoredFile:
        return StoredFile(
            path=self.path,
            content=base64.b64decode(self.content_base64),
            mime_type=self.mime_type,
        )


class CreateSkillBody(BaseModel):
    display_title: str = Field(
        description="Display title for the skill.",
        min_length=1,

View on GitHub (pinned to 4a030776a3)

Solutions

  1. Provide a relative path without any '..' segments.
  2. Remove leading slashes and parent-directory references from the path before submitting.
  3. Sanitize client-supplied paths to reject or normalize traversal sequences.

When it happens

Trigger: Raised during skill file path validation when the path is absolute or contains '..' traversal segments.

Common situations: Uploading a skill bundle whose file entries use absolute paths or parent-directory references; paths must be relative within the bundle.


AI-assisted analysis of zylon-ai/private-gpt@4a030776a3 (2026-08-15). Data as JSON: /api/errors/3d4e2d8ec152970b. Report an issue: GitHub.