Skip to content

Allow synced skill resources to run via shell#1551

Merged
Aaronontheweb merged 3 commits into
netclaw-dev:devfrom
Aaronontheweb:issue-1537-skill-shell-execution
Jul 2, 2026
Merged

Allow synced skill resources to run via shell#1551
Aaronontheweb merged 3 commits into
netclaw-dev:devfrom
Aaronontheweb:issue-1537-skill-shell-execution

Conversation

@Aaronontheweb

@Aaronontheweb Aaronontheweb commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Closes #1537.

Summary

This PR lets synced skill resources run through existing shell_execute instead of adding a new execution tool.

Changes

  • removes .system and .server-feeds from the shell protected-path indicator list while keeping them write-denied
  • supports type: archive private skill-server artifacts with safe ZIP extraction
  • preserves byte content and Unix permission bits when syncing archived resources
  • allows skill resources at any safe relative path under a skill directory, not just references/, scripts/, or assets/
  • updates the built-in skill-authoring guidance for arbitrary AgentSkills.io resources

Safety

  • archive sync rejects traversal paths, symlink entries, duplicate entries, missing/invalid SKILL.md, and unsupported special Unix modes
  • execution still goes through shell_execute and the normal audience/approval policy
  • no skill_execute_resource tool is added

Validation

  • dotnet build Netclaw.slnx
  • dotnet test src/Netclaw.Security.Tests/Netclaw.Security.Tests.csproj --filter "FullyQualifiedName~ToolPathPolicyTests"
  • dotnet test src/Netclaw.Actors.Tests/Netclaw.Actors.Tests.csproj --filter "FullyQualifiedName~SkillScannerTests|FullyQualifiedName~SkillToolTests"
  • dotnet test src/Netclaw.Daemon.Tests/Netclaw.Daemon.Tests.csproj --filter "FullyQualifiedName~ServerFeedSkillSyncServiceTests|FullyQualifiedName~SkillSyncHelpersTests|FullyQualifiedName~SystemSkillSyncServiceTests"
  • dotnet slopwatch analyze
  • pwsh ./scripts/Add-FileHeaders.ps1 -Verify

Not Run

  • ./evals/run-evals.sh: eval-target credentials are not configured in this non-interactive environment (NETCLAW_EVAL_PROVIDER_TYPE, NETCLAW_EVAL_PROVIDER_ENDPOINT, NETCLAW_EVAL_MODEL_ID)

Related

@Aaronontheweb Aaronontheweb added tools Issues related to agent tools: file_read, web_search, shell_execute, image processing, etc. security Security-related changes labels Jul 2, 2026

@Aaronontheweb Aaronontheweb left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite done, just doing my first review pass. Found some issues.

/// <summary>
/// Standard subdirectories within a skill directory that contain resources.
/// </summary>
private static readonly string[] ResourceSubdirectories = ["scripts", "references", "assets"];

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than scan static skill resource directories, we enumerate them on the fly now since the AgentSkills.io standard doesn't mandate strictly these ones.

var subDir = Path.Combine(skillDirectory, subDirName);
if (!Directory.Exists(subDir))
continue;
files = Directory.GetFiles(skillDirectory, "*", SearchOption.AllDirectories);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find all files in this skill directory

return null;
foreach (var file in files.OrderBy(static f => f, StringComparer.Ordinal))
{
if (PathUtility.AreEquivalentPaths(file, Path.Combine(skillDirectory, SkillFileName)))

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validate symlinks et al

Comment thread src/Netclaw.Actors/Tools/SkillManageTool.cs Outdated
Comment thread src/Netclaw.Actors/Tools/SkillReadResourceTool.cs Outdated

@Aaronontheweb Aaronontheweb left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

// -----------------------------------------------------------------------
namespace Netclaw.Actors.Tools;

internal static class SkillResourcePath

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standardized helpers for working with agent skill resources

}
}

internal async Task<List<DownloadedSkillFile>?> ExtractArchiveAsync(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the next release of skill-server, it will expose skills as .zip archives

return null;
}

var mainScan = await _scanner.ScanAsync(skillName, skillContent, cancellationToken);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still scan the content inside the archive

paths.PidFilePath,
paths.LockFilePath,
paths.RestartManifestPath,
paths.SystemSkillsDirectory,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allows these folder to be shell-executable

"/home/user/.netclaw/netclaw.pid",
"/home/user/.netclaw/netclaw.lock",
"/home/user/.netclaw/cache/restart-manifest.json",
"/home/user/.netclaw/skills/.system",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allows tool execution inside here

{
var policy = CreateProductionPolicy();

Assert.False(policy.CommandReferencesDeniedPath(command));

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validate that we no longer deny attempting to execute resources that are provided with skills

@Aaronontheweb
Aaronontheweb marked this pull request as ready for review July 2, 2026 14:00
@Aaronontheweb
Aaronontheweb enabled auto-merge (squash) July 2, 2026 14:01
@Aaronontheweb
Aaronontheweb merged commit e535cd2 into netclaw-dev:dev Jul 2, 2026
15 checks passed
@Aaronontheweb Aaronontheweb mentioned this pull request Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security Security-related changes tools Issues related to agent tools: file_read, web_search, shell_execute, image processing, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skill-server script resources cannot be executed by agents

1 participant