Skill improvements and allow policies#215
Draft
KeremTurgutlu wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on: AnswerDotAI/fastaudit#21 and AnswerDotAI/safepyrun#62
This PR adds three new convenience functions and two
AllowPolicyclasses withallow(...)registrations baked into the skill itself, so the sandbox enforcement is active as soon as the skill is imported.Added 2 new helpers to core:
pr_file_diffreturns the untruncated patch for a single file in a PR — more precise thanread_prwhen you need one exact file.gh_notifswrapsGhApi().activity.list_notifications_for_authenticated_userand formats the result as a compact markdown summary, filtering to relevant reason types by default.ReadOnlyGhPolicyallows onlyGETandHEADverbs, scoped toapi.github.comviaobj.base_url.GitPolicymirrors safecmd's default git allowlist exactly — read-only commands plus reversible workspace commands (fetch,add,commit,switch,checkout) — with special handling forgit config --get/--listandgit stash list. Both policies work with the entry-time hook added in the companionfastaudit/safepyrunPRs, soPermissionErrorraises at call-entry before any side effects, rather than being laundered through httpx as aConnectError/APIError.Note:
gh_queryis re-exported fromghapi.graphqlwith a guard that blocks mutations and subscriptions before they reach the network, since GraphQL uses HTTP POST for all operations (including reads) so verb-based policies can't distinguish them.gh_queryguard does a simple string check formutationandsubscription(case-insensitive).