Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions aws-devops-agent/.kiro/hooks/aws-allow-chat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
Comment thread
Jay2113 marked this conversation as resolved.
# Requires: jq (https://jqlang.github.io/jq/)
# Auto-approve aws___run_script when the code is a SendMessage via call_boto3
# and contains no destructive operation.
# Requires Kiro hook engine with stdin tool-input passthrough (not yet available).
#
# When Kiro adds stdin passthrough, install by adding to your hook config:
# toolTypes: ["aws___run_script"]
# command: ".kiro/hooks/aws-allow-chat.sh"
set -euo pipefail
input=$(cat)
code=$(echo "$input" | jq -r '.tool_input.code // ""')
if echo "$code" | grep -qE "operation_name[[:space:]]*=[[:space:]]*['\"]SendMessage['\"]" && \
! echo "$code" | grep -qE "operation_name[[:space:]]*=[[:space:]]*['\"](Delete|Terminate|Remove|Put|Create|Update)[A-Z]"; then
echo '{"decision": "allow"}'
else
echo '{}'
fi
16 changes: 16 additions & 0 deletions aws-devops-agent/.kiro/hooks/aws-allow-reads.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
Comment thread
Jay2113 marked this conversation as resolved.
# Requires: jq (https://jqlang.github.io/jq/)
# Auto-approve aws___call_aws when the CLI command is a read-only DevOps Agent op.
# Requires Kiro hook engine with stdin tool-input passthrough (not yet available).
#
# When Kiro adds stdin passthrough, install by adding to your hook config:
# toolTypes: ["aws___call_aws"]
# command: ".kiro/hooks/aws-allow-reads.sh"
set -euo pipefail
input=$(cat)
cli_command=$(echo "$input" | jq -r '.tool_input.cli_command // ""')
operation=$(echo "$cli_command" | sed -n 's/.*devops-agent[[:space:]]\+\([a-z]\+\-[a-z-]\+\).*/\1/p')
case "$operation" in
list-*|describe-*|get-*) echo '{"decision": "allow"}' ;;
*) echo '{}' ;;
esac
Loading