skill_approval
Approval abstractions for manifest-based skill scripts.
DenyAllSkillScriptApprover
Default approver that denies all skill script execution.
Source code in src/mada/core/skills/skill_approval.py
approve_skill_script(request)
Deny every skill script invocation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
SkillScriptApprovalRequest
|
Approval request describing the script. |
required |
Returns:
| Type | Description |
|---|---|
SkillScriptApprovalDecision
|
A denial decision explaining that no approver was configured. |
Source code in src/mada/core/skills/skill_approval.py
PolicyBasedSkillScriptApprover
Config-driven approver for skill-specific script approval policies.
Source code in src/mada/core/skills/skill_approval.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |
__init__(default_mode='deny', skill_modes=None)
Initialize a policy approver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
default_mode
|
str
|
Mode applied when no override matches. Either "approve" or "deny"; unrecognized values fall back to "deny". |
'deny'
|
skill_modes
|
dict[str, str] | None
|
Per-skill and per-script overrides keyed by "skill_name:script_name", "skill_name", or "*". |
None
|
Source code in src/mada/core/skills/skill_approval.py
approve_skill_script(request)
Decide whether a script may run based on configured policy.
Overrides are matched most specific first: an exact "skill_name:script_name" key, then "skill_name", then "*". When none match, the default mode applies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
SkillScriptApprovalRequest
|
Approval request describing the script. |
required |
Returns:
| Type | Description |
|---|---|
SkillScriptApprovalDecision
|
The policy's approval decision. |
Source code in src/mada/core/skills/skill_approval.py
PromptingSkillScriptApprover
Interactive approver that asks a user to authorize each skill script.
Source code in src/mada/core/skills/skill_approval.py
__init__(input_func=input, output_func=print)
Initialize an interactive approver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_func
|
Callable[[str], str]
|
Callable used to read the user's response. |
input
|
output_func
|
Callable[[str], None]
|
Callable used to display the approval prompt. |
print
|
Source code in src/mada/core/skills/skill_approval.py
approve_skill_script(request)
Ask the user whether a skill script may run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
SkillScriptApprovalRequest
|
Approval request describing the script. |
required |
Returns:
| Type | Description |
|---|---|
SkillScriptApprovalDecision
|
An approval decision reflecting the user's response. Anything other |
SkillScriptApprovalDecision
|
than an explicit yes is treated as a denial. |
Source code in src/mada/core/skills/skill_approval.py
SkillScriptApprovalDecision
dataclass
SkillScriptApprovalRequest
dataclass
Approval request for one manifest-discovered skill script invocation.
Source code in src/mada/core/skills/skill_approval.py
SkillScriptApprover
Bases: Protocol
Interface for deciding whether one skill script may run.
Source code in src/mada/core/skills/skill_approval.py
approve_skill_script(request)
build_skill_script_approver(config, input_func=input, output_func=print)
Build the skill script approver described by runtime configuration.
A default mode of "prompt" selects an interactive approver that asks the
user to authorize each script. Any other mode selects a policy approver
driven by skill_script_approval_modes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
Any
|
Skill runtime configuration. |
required |
input_func
|
Callable[[str], str]
|
Callable used to read a user's approval response. |
input
|
output_func
|
Callable[[str], None]
|
Callable used to display approval prompts. |
print
|
Returns:
| Type | Description |
|---|---|
SkillScriptApprover
|
An approver implementing the |