You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/develop/using-ai-for-mod-development.md
+24-20Lines changed: 24 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
---
2
-
title: Using AI for Control Development
3
-
sidebar_label: Using AI for Control Development
2
+
title: Using AI for Mod Development
3
+
sidebar_label: Using AI for Mod Development
4
4
---
5
5
6
-
# Using AI for Control Development
6
+
# Using AI for Mod Development
7
7
8
8
Creating new benchmarks, dashboards, and controls for Powerpipe mods with AI tools and IDEs works remarkably well. At Turbot, we develop these components frequently and use AI for almost every new implementation. The key is working within existing mod repositories - this gives AI tools access to established patterns and conventions to generate consistent, high-quality results.
9
9
10
-
If you're looking to use AI to run Powerpipe controls rather than develop new ones, you can use the [Powerpipe MCP server](../run/mcp), which provides powerful tools for AI agents to inspect and run controls, benchmarks, and queries.
10
+
If you're looking to use AI to run Powerpipe benchmarks, dashboards, and controls rather than develop new ones, you can use the [Powerpipe MCP server](../run/mcp), which provides powerful tools for AI agents to inspect and run controls, benchmarks, and queries.
11
11
12
12
## Getting Started
13
13
@@ -22,17 +22,16 @@ While AI often works well with simple requests like "Create a control for [requi
22
22
23
23
### Create Control
24
24
25
-
First, create the new control using existing controls and docs as reference.
25
+
First, create the complete control and its documentation, using existing controls and documentation as reference.
26
26
27
27
#### Prompt
28
28
29
29
```md
30
-
Your goal is to create a new Powerpipe control for <service> <resource type> and <check condition>.
30
+
Your goal is to create a new Powerpipe control for <resource type> to check for <condition>.
31
31
32
32
1. Review existing benchmarks and controls and their documentation in the mod to understand the established patterns, naming conventions, and query structure.
33
33
34
34
2. Create the control and add it to any benchmark with similar controls in it.
35
-
36
35
```
37
36
38
37
### Run Control
@@ -42,7 +41,7 @@ Next, verify your control is properly configured and can be executed without err
42
41
#### Prompt
43
42
44
43
```md
45
-
Your goal is to verify the <service> <resource type> control compiles and runs correctly.
44
+
Your goal is to verify the <resource type> control compiles and runs correctly.
46
45
47
46
1. Check the Steampipe service status with `steampipe service status`. Start it with `steampipe service start` if not running, or restart it with `steampipe service restart` if already running.
48
47
@@ -60,30 +59,35 @@ To test the control's functionality, you'll need resources to query. You can eit
60
59
61
60
#### Prompt
62
61
63
-
To test the control's functionality, you'll need resources that will trigger both passing and failing results.
64
-
65
62
```md
66
-
Your goal is to create test resources for validation.
63
+
Your goal is to create test resources for <resource_type> to check for <condition> to validate your Powerpipe control implementation.
67
64
68
-
1. Create resources using provider's CLI, Terraform, or API.
69
-
- Use the most cost-effective configuration. If the estimated cost is high, e.g., $50, warn about the expense rather than proceeding.
65
+
1. Create test resources with as many properties set as possible.
66
+
- Use the provider's CLI if available, Terraform configuration if CLI isn't available, or API calls via shell script as a last resort.
67
+
- Create any dependent resources needed.
68
+
- Use the most cost-effective configuration. If the estimated cost is high, e.g., $50, warn about the expense rather than proceeding.
70
69
71
70
2. Verify that all resources were created successfully using the same tool or method used for creation.
72
71
```
73
72
74
73
### Validate Results
75
74
76
-
Next, run the control to verify it correctly identifies the test resources.
75
+
Next, run the control to verify it correctly identifies and evaluates resources.
77
76
78
77
#### Prompt
79
78
80
79
```md
81
-
Your goal is to verify the control correctly identifies compliant and non-compliant resources.
80
+
Your goal is to verify the control correctly evaluates the test resources.
81
+
82
+
Use the Powerpipe MCP server for running controls if available, otherwise use the `powerpipe` CLI commands directly.
83
+
84
+
1. Run the control against your test resources.
82
85
83
-
1. Run the control using the MCP server or `powerpipe control run <control_name>`.
86
+
2. Verify the control returns the expected state for each resource.
84
87
85
-
2. Verify the control returns expected results.
88
+
3. Confirm the control's reason field accurately describes the current state of the resource.
86
89
90
+
4. Share the validation results in raw Markdown format, including the full control output showing resource evaluation.
87
91
```
88
92
89
93
### Cleanup Test Resources
@@ -93,9 +97,9 @@ After testing is completed, remove any resources created for testing.
93
97
#### Prompt
94
98
95
99
```md
96
-
Your goal is to remove all test resources created for this control.
100
+
Your goal is to clean up all test resources created for <resource type> validation to avoid ongoing costs.
97
101
98
-
1. Delete all test resources using the same tool used to create them (CLI, Terraform, API).
102
+
1. Delete all resources created for testing, including any dependent resources, using the same method that was used to create them.
99
103
100
-
2. Run the control again to verify no resources are returned.
104
+
2. Verify that all resources were successfully deleted, using the same method that was used to delete them.
0 commit comments