You can use the jQuery UI sortable options items
or cancel
for this purpose. Docs here: http://jqueryui.com/sortable/#items.
You would add them in a binding like:
<div class="container" data-bind="sortable: { data: tasks, options: { cancel: '.prevent' } }">
or globally like:
ko.bindingHandlers.sortable.options.cancel = ".prevent";
Sample here: http://jsfiddle.net/rniemeyer/2wEX3/