Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ def upgrade() -> None:
sa.Column('updated_at', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id'),
if_not_exists=True,
)
op.create_index(op.f('ix_webhook_configs_id'), 'webhook_configs', ['id'], unique=False)
op.create_index(op.f('ix_webhook_configs_id'), 'webhook_configs', ['id'], unique=False, if_not_exists=True)


def downgrade() -> None:
op.drop_index(op.f('ix_webhook_configs_id'), table_name='webhook_configs')
op.drop_table('webhook_configs')
op.drop_index(op.f('ix_webhook_configs_id'), table_name='webhook_configs', if_exists=True)
op.drop_table('webhook_configs', if_exists=True)
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ def upgrade() -> None:
sa.Column('changed_at', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['ai_system_id'], ['ai_systems.id'], ),
sa.ForeignKeyConstraint(['changed_by_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
sa.PrimaryKeyConstraint('id'),
if_not_exists=True,
)
op.create_index(op.f('ix_ai_system_audit_logs_id'), 'ai_system_audit_logs', ['id'], unique=False)
op.create_index(op.f('ix_ai_system_audit_logs_id'), 'ai_system_audit_logs', ['id'], unique=False, if_not_exists=True)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_ai_system_audit_logs_id'), table_name='ai_system_audit_logs')
op.drop_table('ai_system_audit_logs')
op.drop_index(op.f('ix_ai_system_audit_logs_id'), table_name='ai_system_audit_logs', if_exists=True)
op.drop_table('ai_system_audit_logs', if_exists=True)
# ### end Alembic commands ###
12 changes: 11 additions & 1 deletion tests/test_scan_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ def test_scan_prompts_blocks_malicious_prompt(tmp_path, monkeypatch):

assert exit_code == 1
assert (tmp_path / "report.json").exists()

client.post.assert_called_once()

args, kwargs = client.post.call_args
assert "ignore all previous instructions" in str(kwargs)


def test_scan_prompts_passes_clean_prompt(tmp_path, monkeypatch):
Expand Down Expand Up @@ -65,4 +70,9 @@ def test_scan_prompts_passes_clean_prompt(tmp_path, monkeypatch):
exit_code = module.main()

assert exit_code == 0
assert (tmp_path / "report.json").exists()
assert (tmp_path / "report.json").exists()

client.post.assert_called_once()

args, kwargs = client.post.call_args
assert "Summarize the policy in three bullets." in str(kwargs)